Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
mahesh_bote
Constraint Violating Yak Guru
298 Posts |
Posted - 2006-06-20 : 03:35:24
|
| why we use there query?select 0 <zero> from <table name>0 - zeroBMahesh |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2006-06-20 : 03:38:45
|
i don't, it just returns the value 0 for all rows in the the tableif you're using it, ask the DBA or developer who used it --------------------keeping it simple... |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-06-20 : 03:41:38
|
No idea. - Maybe check for existance of table (but there are better way to do this) ? - Or Maybe by the number of rows return determine number of records (select count(*) from table will be more efficient) ?Ask the programmer ! KH |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-06-28 : 06:58:05
|
quote: Originally posted by mahesh_bote why we use there query?select 0 <zero> from <table name>0 - zeroBMahesh
Usually this is used to check if row exists in a table without worry about actual data. It can be also used asIf exists(Select 0...)MadhivananFailing to plan is Planning to fail |
 |
|
|
KenW
Constraint Violating Yak Guru
391 Posts |
Posted - 2006-06-28 : 14:55:43
|
| At a company I used to work for, the first interview question for someone claiming knowledge of Oracle SQL was:"What's the result of the query 'SELECT 'A' from dual' ?"If they couldn't answer, the interview was over. :-)Ken |
 |
|
|
|
|
|