About 112,000 results
Open links in new tab
  1. What does it mean `SELECT 1 FROM table`? - Stack Overflow

    I have seen many queries with something as follows: SELECT 1 FROM table What does this 1 mean, how will it be executed, and what will it return? Also, in what type of scenarios can this …

  2. sql server - What does "select 1 from" do? - Stack Overflow

    Jan 8, 2016 · I read some articles but really didn't understand what does select 1 from do? Someone says "you should use select 1 instead of select *". Here is an example table: cust_id …

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

    Dec 29, 2016 · I have always used select top 1 'x' (SQL Server) Theoretically, select top 1 'x' would be more efficient that select *, as the former would be complete after selecting a …

  4. sql - What does select 1 do? - Stack Overflow

    Nov 18, 2016 · SELECT 1 just return 1 , that is just a constant so the query return something and the EXISTS return true. You can use anything. 1 is just the common one and because is a …

  5. sql - Why is there a SELECT 1 from table? - Stack Overflow

    Oct 3, 2011 · Therefore when using EXISTS or NOT EXISTS you do not need to actually select a particular value so selecting a placeholder (in this case "1") is enough. In your particular SQL …

  6. Diff between Top 1 1 and Select 1 in SQL Select Query

    Oct 14, 2013 · select top 1 1 from Worker W where not exists (select 1 from Manager M where M.Id = W.Id) what is the diff between select "TOP 1 1" and "SELECT 1" in sql server query ?

  7. sql - Exists / not exists: 'select 1' vs 'select field' - Stack Overflow

    Sep 11, 2016 · And Oracle: An EXISTS condition tests for existence of rows in a subquery. Maybe the MySQL documentation is even more explaining: Traditionally, an EXISTS subquery …

  8. sql server - Which is better select 1 vs select * to check the ...

    Nov 7, 2014 · 22 EXISTS will check if any record exists in a set. so if you are making a SELECT from 1 million records or you are making a SELECT from 1 record (let say using TOP 1), they …

  9. What is the purpose of using WHERE 1=1 in SQL statements?

    Aug 12, 2009 · WHERE 1=1 is not "ignored" by database systems - 1=1 always evaluates to TRUE so this is the syntactic equivalent of WHERE TRUE. The database always evaluates all …

  10. Qual é o uso do 'SELECT 1'? - Stack Overflow em Português

    Nov 2, 2015 · Gostei da resposta. Apesar de que fazendo uma rápida pesquisa aqui, verifiquei que realizados alguns testes usando o SELECT 1 e o SELECT * em subqueries, não deu …