SQL server ignore case in a where expression

In the default configuration of a SQL Server database, string comparisons are case-insensitive. If your database overrides this setting (through the use of an alternate collation), then you’ll need to specify what sort of collation to use in your query. SELECT * FROM myTable WHERE myField = ‘sOmeVal’ COLLATE SQL_Latin1_General_CP1_CI_AS Note that the collation I … Read more

MySQL join with where clause

You need to put it in the join clause, not the where: SELECT * FROM categories LEFT JOIN user_category_subscriptions ON user_category_subscriptions.category_id = categories.category_id and user_category_subscriptions.user_id =1 See, with an inner join, putting a clause in the join or the where is equivalent. However, with an outer join, they are vastly different. As a join condition, … Read more