Structured Query Language (SQL) is a language for querying databases. Questions should include code examples, table structure, sample data, and a tag for the DBMS implementation (e.g. MySQL, PostgreSQL, Oracle, MS SQL Server, IBM DB2, etc.) being used. If your question relates solely to a specific DBMS (uses specific extensions/features), use that DBMS's tag instead. Answers to questions tagged with SQL should use ISO/IEC standard SQL.
I need to update this table in SQL Server with data from its 'parent' table, see below: Table: sale
I want to delete using INNER JOIN in SQL Server 2008. But I get this error: Msg 156, Level 15, State 1, L
What is the difference between UNION and UNION ALL?
I am trying to INSERT INTO a table using the input from another table. Although this is entirely feasible for
As the title suggests, I'd like to select the first row of each set of rows grouped with a GROUP BY. Spec
How do I perform an IF...THEN in an SQL SELECT statement? For example: SELECT IF(Obsolete = 'N' OR
I want to query something with SQL's like query: SELECT * FROM users WHERE name LIKE '%m%' Ho
How do I do a SELECT * INTO [temp table] FROM [stored procedure]? Not FROM [Table] and without defining [temp
SELECT GETDATE() Returns: 2008-09-22 15:24:13.790 I want that date part without the time part: 2008-09-22 0
Consider a database table holding names, with three rows: Peter Paul Mary Is there an easy way to turn this i
It's easy to find duplicates with one field: SELECT name, COUNT(email) FROM users GROUP BY email HAVING
I have a .sql file with an export from phpMyAdmin. I want to import it into a different server using the comma
How can I add a column with a default value to an existing table in SQL Server 2000 / SQL Server 2005?
In SQL Server, it is possible to insert rows into a table with an INSERT.. SELECT statement: INSERT INTO Table
Also how do LEFT JOIN, RIGHT JOIN and FULL JOIN fit in?