Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««123

Know your UNION(s), NULL(s), COUNT(s) ? Expand / Collapse
Author
Message
Posted Tuesday, June 10, 2008 11:42 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Saturday, January 25, 2014 2:45 PM
Points: 62, Visits: 125
re PL/SQL: I confess that I have been visiting the 'dark side'.
Post #514677
Posted Tuesday, September 16, 2008 6:22 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, October 4, 2012 11:13 AM
Points: 257, Visits: 80
I went to check my guess and ran:
WITH DATA (Numbers) AS
(SELECT NULL UNION ALL
SELECT NULL UNION ALL
SELECT NULL UNION ALL
SELECT 1 UNION ALL
SELECT 2 UNION
SELECT 3)
SELECT COUNT(ALL Numbers) AS NULLNumberCount FROM DATA
WHERE Numbers IS NULL

and got:
Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'WITH'.

Ooops
Post #570134
Posted Tuesday, September 16, 2008 6:28 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Wednesday, February 24, 2010 4:10 AM
Points: 1,553, Visits: 2,232
if your with is not the first line of code, then you need a ; before it

----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley


Posting Best Practices
Numbers / Tally Tables

SQL-4-Life
Post #570140
Posted Tuesday, September 16, 2008 6:47 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, October 4, 2012 11:13 AM
Points: 257, Visits: 80
Christopher Stobbs (9/16/2008)
if your with is not the first line of code, then you need a ; before it


Ok, it worked. Thanks.
Post #570167
Posted Wednesday, December 5, 2012 11:02 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Thursday, July 10, 2014 11:20 AM
Points: 1,888, Visits: 2,323
gr8 question....


_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #1393325
« Prev Topic | Next Topic »

Add to briefcase «««123

Permissions Expand / Collapse