Follow The Programmer Blog RSS feed to stay up to date with the latest programming tutorials regarding anything SQL. If you're looking to upgrade your software developer shirt collection we offer some pretty cool programmer shirts. For more of the latest developer news and programming tutorials visit The Programmer Blog. View all programming tutorials tagged with SQL below:


SQL - How do I UPDATE from a SELECT in SQL Server?

In SQL Server it's possible to INSERT into a table, but can you do the same for UPDATE? The is a common question when learning SQL and learning how to UPDATE from a SELECT in SQL Server.  In SQL Server 2008 (or better), use MERGE MERGE INTO Table_A A USING ( SELECT id, col1, col2 FROM Table_B WHERE tsql = 'cool'...

Read more

SQL, SQL Server

SQL - The OR in the when clause  error

This is a common error when you are attempting to use an OR to satisfy multiple conditions in a WHEN statement. "The OR in the WHEN clause of a CASE statement is not supported." Consider this SQL which currently gives the "The OR in the WHEN clause of a CASE statement is not supported" error: CASE ebv.db_no WHEN 22978 OR 23218 OR 23219 THEN 'WECS 9500' ELSE 'WECS 9520' END as wecs_system...

Read more