About 36,400,000 results
Open links in new tab
  1. How do I perform an IF...THEN in an SQL SELECT?

    Sep 15, 2008 · I prefer the conciseness when compared with the expanded CASE version. Both IIF() and CASE resolve as expressions within a SQL statement and can only be used in well …

  2. sql - What is SELF JOIN and when would you use it? - Stack Overflow

    Jun 13, 2024 · You use a self join when a table references data in itself. E.g., an Employee table may have a SupervisorID column that points to the employee that is the boss of the current …

  3. using "USE" keyword Vs. full table name in T-SQL

    Feb 18, 2014 · I'd tend to use [server].[database].[schema].[table] in instances where a script may query mutliple tables from multiple databases. The USE [database] would typically be used in …

  4. sql - Can I use multiple "with"? - Stack Overflow

    Nov 24, 2015 · These are CTEs - Common Table Expressions. They are more like... named queries that you can use as if they were tables... or rather more like views. Please google …

  5. What's the purpose of SQL keyword "AS"? - Stack Overflow

    Nov 12, 2010 · SELECT * FROM table AS t1; What's the difference between them if any? I see old DBA people tend to write statements without AS, but most of the new tutorials use it. …

  6. sql - How to use "and" and "or" in a "Where" clause - Stack Overflow

    I have a query that is gathering information based on a set of conditions. Basically I want to know if a location has paid out more than $50 for the day OR the comment section has the word …

  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. Should I use != or <> for not equal in T-SQL? - Stack Overflow

    I have seen SQL that uses both != and <> for not equal. What is the preferred syntax and why? I like !=, because <> reminds me of Visual Basic.

  9. Equivalent of LIMIT and OFFSET for SQL Server? - Stack Overflow

    In PostgreSQL there is the Limit and Offset keywords which will allow very easy pagination of result sets. What is the equivalent syntax for SQL Server?

  10. How to declare variable and use it in the same Oracle SQL script ...

    The question is about to use a variable in a script means to me it will be used in SQL*Plus. The problem is you missed the quotes and Oracle can not parse the value to number.