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

    Using the exists operator, your subquery can return zero, one, or many rows, and the condition simply checks whether the subquery returned any rows. If you look at the select clause of the subquery, you …

  2. 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?

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

    Nov 23, 2010 · For example if you want to check if user exists before inserting it into the database the query can look like this:

  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] od …

  5. SQL Server: IF EXISTS ; ELSE - Stack Overflow

    SQL Server: IF EXISTS ; ELSE Asked 14 years, 2 months ago Modified 6 years, 2 months ago Viewed 745k times

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

  8. 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 in a …

  9. 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" rows (unless we …

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