in reply to Re: MySQL
in thread Filtering MySQL results

screamingeagle wrote:

In SQL Server, the check is not case-sensitive, however , if you're using oracle, you might want to write the SQL Stmt like this :

SELECT username,password,group FROM users where upper(group) = upper('admin')
The problem with this is that unless the database engine is very advanced, this will table scan instead of using an index. The reason is that it needs to run a function on one of your columns, and the optimizer has no idea what the result of that function call will be before hand. So, it needs to calculate it for every row when you do your query.

You are in luck, however, in that there are alternative solutions to the problem. One is to create a rule on the column that only allows certain known values. The second is to have the upper in your insert statement, thus canonicalizing the values in the column. I'm sure there are more, but this should get you started.

thor