About 510,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 …

  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 Server: IF EXISTS ; ELSE - Stack Overflow

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

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

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

    Jul 27, 2011 · "The EXISTS also makes it clear you aren't interested in [rows from the inner tables" - also known as a "semi-join", and may show up in query plans as that. (I've seen SQL …

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

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

  10. How to check if a Constraint exists in Sql server?

    Mar 23, 2010 · The SQL Server docs mention it here under the ALTER TABLE page, and not under this Delete Check Constraints page. I'm not sure why. IF EXISTS Applies to: SQL …