|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Wednesday, March 27, 2013 9:22 AM
Points: 226,
Visits: 278
|
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 6:46 AM
Points: 5,102,
Visits: 20,207
|
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 3:34 PM
Points: 2,170,
Visits: 3,582
|
|
Good question. I got to know something.
Mohammed Moinudheen
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, July 25, 2011 1:03 AM
Points: 3,
Visits: 4
|
|
| Very Good basic question !
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Today @ 6:28 AM
Points: 1,258,
Visits: 4,259
|
|
I looked at the question, thought, "Surely this is obvious"--went and ran it in SSMS just to be sure I wasn't missing something. It was only when I came here I realised it was talking about the missing FROM clause!
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Yesterday @ 1:51 AM
Points: 1,972,
Visits: 1,821
|
|
If the condition of the WHERE clause validates to true then the result set is returned. If it does not, the result set is empty. This is true only if you do not use COUNT(*):
select count(*) cnt where 1 =0 One row is returned despite the WHERE condition is false.
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: 2 days ago @ 5:38 AM
Points: 285,
Visits: 102
|
|
Interestingly, this gives ORA-00923 error - FROM keyword not found where expected in Oracle. (Hence I got it wrong!)
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 4:24 AM
Points: 1,161,
Visits: 642
|
|
Geoff Langdon (6/23/2011) Interestingly, this gives ORA-00923 error - FROM keyword not found where expected in Oracle. (Hence I got it wrong!)
Geoff how about:
1 select '123' as col1 2 from dual 3* where 1 =1 orhousin@BUSO> /
COL --- 123
I was expecting this question to have almost 100% correct answers...
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Today @ 8:31 AM
Points: 3,129,
Visits: 4,312
|
|
Having worked with MSSQL, Oracle, Db2, Sybase and Informix databases, the only ones this command will work on is MSSQL and Sybase. All the others require a FROM clause with a SELECT
____________________________________________ Space, the final frontier? not any more... All limits henceforth are self-imposed. “libera tute vulgaris ex”
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Yesterday @ 7:11 AM
Points: 877,
Visits: 1,159
|
|
|
|
|