Here is my code:
SELECT SRV_NAME, TOT_CPU, TOT_MEM, SNAP_DATE FROM capacity.SRV_CAPACITY_SEV WHERE SRV_NAME in ('absshs1p", "AA03server', 'AA02server', 'BA01server', 'BA03server', 'BC03server') AND SNAP_DATE BETWEEN to_date('10-jun-2012 00:00:00', 'dd-mon-yyyy hh24:mi:ss') AND to_date('12-jun-2012 00:00:00', 'dd-mon-yyyy hh24:mi:ss') ORDER BY SRV_NAME desc, SNAP_DATE desc;
How would I query for servers that begin with certain characters? For example, how could I serach for servers that only begin with 'AA'?
I am using Oracle SQL btw.
ssll If you want to match the start of the string you should use 'ss%' instead. select * from table_name where column_name line 'ss%'; this query will return only ssll.
To check if a name begins ends with a vowel we use the string functions to pick the first and last characters and check if they were matching with vowels using in where the condition of the query. We use the LEFT() and RIGHT() functions of the string in SQL to check the first and last characters.
You can do this
WHERE SRV_NAME LIKE 'AA%'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With