Structured Query Language (SQL) is a language for querying databases.
In SQL Server, it is possible to insert rows into a table with an INSERT.. SELECT statement: INSERT INTO Table (…
sql sql-server tsql selectHow do I perform an IF...THEN in an SQL SELECT statement? For example: SELECT IF(Obsolete = 'N' OR InStock = …
sql sql-server tsql if-statement caseI have a .sql file with an export from phpMyAdmin. I want to import it into a different server using …
mysql sql command-line importThe OR operator in the WHEN clause of a CASE statement is not supported. How can I do this? CASE …
sql sql-server tsql case case-whenHow can I add a column with a default value to an existing table in SQL Server 2000 / SQL Server 2005?
sql sql-server sql-server-2005 sql-server-2000It's easy to find duplicates with one field: SELECT name, COUNT(email) FROM users GROUP BY email HAVING COUNT(email) &…
sql duplicatesSELECT GETDATE() Returns: 2008-09-22 15:24:13.790 I want that date part without the time part: 2008-09-22 00:00:00.000 How can I get …
sql sql-server tsql date datetimeI have multiple set of data to insert at once, say 4 rows. My table has three columns: Person, Id and …
sql sql-server tsql insertI am trying to INSERT INTO a table using the input from another table. Although this is entirely feasible for …
sql database syntax database-agnostic ansi-sql-92Consider a database table holding names, with three rows: Peter Paul Mary Is there an easy way to turn this …
sql sql-server csv string-concatenation group-concat