About 2,960,000 results
Open links in new tab
  1. 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 …

  2. 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] …

  3. What does the "@" symbol do in SQL? - Stack Overflow

    The @CustID means it's a parameter that you will supply a value for later in your code. This is the best way of protecting against SQL injection. Create your query using parameters, rather than …

  4. 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.

  5. What is the use of the square brackets [] in sql statements?

    The Microsoft book for SQL course says "You should use two-part names to refer to tables in SQL Server databases, such as Sales.Customer" so they don't ask to surround namespace with …

  6. 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 …

  7. 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 …

  8. SQL WITH clause example - Stack Overflow

    Sep 23, 2012 · 353 The SQL WITH clause was introduced by Oracle in the Oracle 9i release 2 database. The SQL WITH clause allows you to give a sub-query block a name (a process also …

  9. SQL Query Where Field DOES NOT Contain $x - Stack Overflow

    Oct 24, 2008 · I want to find an SQL query to find rows where field1 does not contain $x. How can I do this?

  10. 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 …