About 2,960,000 results
Open links in new tab
  1. sql - NOT IN vs NOT EXISTS - Stack Overflow

    Which of these queries is the faster? NOT EXISTS: SELECT ProductID, ProductName FROM Northwind..Products p WHERE NOT EXISTS ( SELECT 1 FROM Northwind..[Order Details] …

  2. Should I use != or <> for not equal in T-SQL? - Stack Overflow

    Yes; Microsoft themselves recommend using <> over != specifically for ANSI compliance, e.g. in Microsoft Press training kit for 70-461 exam, "Querying Microsoft SQL Server", they say "As …

  3. What does SQL Select symbol || mean? - Stack Overflow

    Apr 29, 2014 · sql server: + (infix operator), concat ( vararg function ) Edit : Now Azure SQL also supports ANSI SQL standard || operator for string concatenation. Docs link.

  4. SQL: IF clause within WHERE clause - Stack Overflow

    Sep 18, 2008 · Is it possible to use an IF clause within a WHERE clause in MS SQL? Example: WHERE IF IsNumeric(@OrderNumber) = 1 OrderNumber = @OrderNumber ELSE …

  5. SQL JOIN: what is the difference between WHERE clause and ON …

    SQL INNER JOIN The SQL JOIN clause allows you to associate rows that belong to different tables. For instance, a CROSS JOIN will create a Cartesian Product containing all possible …

  6. How do I perform an IF...THEN in an SQL SELECT?

    Sep 15, 2008 · The CASE statement is the closest to IF in SQL and is supported on all versions of SQL Server. SELECT CAST( CASE WHEN Obsolete = 'N' or InStock = 'Y' THEN 1 ELSE 0 …

  7. How to fix Recovery Pending State in SQL Server Database?

    Sep 14, 2018 · Rename the DB and the Log files (Database Properties -> Files) In the Object Explorer window in SQL Management Studio, refresh the 'Databases Folder', if you see that …

  8. sql - Exclude a column using SELECT * [except columnA] FROM …

    FROM TableA This very powerful SQL syntax avoids a long list of columns that must be constantly updated due to table column name changes. This functionality is missing in the …

  9. sql - Incorrect syntax near '' - Stack Overflow

    I'm trying to run the following fairly simple query in SQL Server Management Studio: SELECT TOP 1000 * FROM master.sys.procedures as procs left join master.sys.parameters as params …

  10. Simple way to transpose columns and rows in SQL?

    How do I simply switch columns with rows in SQL? Is there any simple command to transpose? ie turn this result: Paul | John | Tim | Eric Red 1 5 1 3 Green 8 ...