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 |
phate06
Starting Member
17 Posts |
Posted - 2013-09-04 : 06:06:58
|
Hi GuysI need to return three individual results based on one table, below is my query but it does not like it, I am getting syntax errors see below too - can any one advise?select (Select (COUNT (CustomerID)) as 'Trade Account' from customer where CustomerCode like 'TRC%' and Deleted = 0Select (COUNT (CustomerID)) as 'Credit Account'from Customer where CustomerCode not like 'TRC%' and Deleted=0 and CashAccount=0Select (COUNT (CustomerID)) as 'Cash Account' from Customer where CustomerCode like 'CAS%' and Deleted=0 and CashAccount=1)From CustomerMsg 156, Level 15, State 1, Line 4Incorrect syntax near the keyword 'Select'.Msg 102, Level 15, State 1, Line 6Incorrect syntax near ')'. |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2013-09-04 : 07:38:06
|
Duplicate:http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=187972 |
|
|
|
|
|