Page 1 of 1

case in-sensitive sql query

PostPosted: Tue Nov 06, 2012 7:33 pm
by raghuvanshi
In the interview test one of the questions was asked in which I have doubt is below-:

If a table has a VARCHAR columns, containing values: prod,system,PROD,Test,Prod. Which one of the following queries will find all the records containing 'PROD' irrespective of the case?

a) SELECT * FROM TABLE WHERE COLUMN=IGNORE_CASE('PROD')
b) SELECT * FROM TABLE WHERE COLUMN=LOWER_CASE('prod')
c) SELECT * FROM TABLE WHERE LCASE(COLUMN)='prod'
d.) None of these
My answer was a)

Re: case in-sensitive sql query

PostPosted: Wed Nov 07, 2012 8:06 pm
by raghuvanshi
Hi,

Any suggestions are welcome.

Re: case in-sensitive sql query

PostPosted: Wed Nov 07, 2012 8:15 pm
by BillyBoyo
With the benefit of the time that has elapsed, what have you discovered by looking in the manuals?

Re: case in-sensitive sql query

PostPosted: Thu Nov 08, 2012 12:11 pm
by raghuvanshi
C is the correct answer

Re: case in-sensitive sql query

PostPosted: Thu Nov 08, 2012 3:19 pm
by BillyBoyo
That's nice and definitive. Can you provide a link to the manual reference that you found, it can help other people looking at the same type of thing in the future?

Re: case in-sensitive sql query

PostPosted: Thu Nov 08, 2012 8:33 pm
by raghuvanshi