About 533,000 results
Open links in new tab
  1. How do SQL EXISTS statements work? - Stack Overflow

    I'm trying to learn SQL and am having a hard time understanding EXISTS statements. I came across this quote about "exists" and don't understand something: Using the exists operator, …

  2. SQL: How to properly check if a record exists - Stack Overflow

    Nov 23, 2010 · While reading some SQL Tuning-related documentation, I found this: SELECT COUNT(*) : Counts the number of rows. Often is improperly used to verify the existence of a …

  3. Difference between EXISTS and IN in SQL? - Stack Overflow

    Aug 24, 2008 · What is the difference between the EXISTS and IN clause in SQL? When should we use EXISTS, and when should we use IN?

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

  5. sql server - EXISTS (SELECT 1 ...) vs EXISTS (SELECT * ...) One or the ...

    Dec 29, 2016 · Products like SQL Server, Oracle, MySQL and SQLite will happily accept SELECT * in the above query without any errors, which probably means they treat an EXISTS SELECT …

  6. SQL Server IF EXISTS THEN 1 ELSE 2 - Stack Overflow

    Using Sql Server 2012. I have a stored procedure and part of it checks if a username is in a table. If it is, return a 1, if not, return a 2. This is my code: IF EXISTS (SELECT * FROM tblGLUserA...

  7. sql - EXISTS vs JOIN and use of EXISTS clause - Stack Overflow

    Please note that EXISTS with an outer reference is a join, not just a clause. It is a semi-join (and NOT EXISTS is an anti-semi-join). Also, you can use EXISTS to join tables, one example …

  8. How do I use T-SQL's Exists keyword? - Stack Overflow

    Jul 27, 2011 · Several possible SQL statements given as solutions. IMPORTANT NOTE: the statements that JOIN the other tables in the outer query have the potential to return "duplicate" …

  9. How to use SQL Select statement with IF EXISTS sub query?

    How to select Boolean value from sub query with IF EXISTS statement (SQL Server)? It should be something like : SELECT TABLE1.Id, NewFiled = (IF EXISTS (SELECT Id FROM TABLE2 …

  10. SQL Queries using EXISTS and OR operator - Stack Overflow

    Dec 20, 2012 · SQL Queries using EXISTS and OR operator Asked 12 years, 10 months ago Modified 8 years, 4 months ago Viewed 22k times