| | |
Small MSSQL problem
Please support our MS SQL advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Jan 2007
Posts: 23
Reputation:
Solved Threads: 0
I'm using this piece of code to get the number of search results. However it says- Incorrect syntax near ')' (the very last ')' )
The inner select works fine and gives correct results, so I don't understand what's the problem... I won't be surprised if it's something stupid, but I've tried lots of things but with no success..
So I hope you guys can give some hints.
MS SQL Syntax (Toggle Plain Text)
SELECT COUNT(*) FROM (SELECT ID, ProductDescription FROM Products WHERE ProductDescription LIKE '%tech%')
So I hope you guys can give some hints.
Last edited by Wiizl; Oct 16th, 2009 at 8:14 am.
1
#2 Oct 16th, 2009
You need to name the table alias in your sub select.
This will fail:
This will work:
Just stick an "as tblName" clause regardless of whether you use it.
In the future please post Microsoft SQL Questions to the MSSQL Forum.
This will fail:
sql Syntax (Toggle Plain Text)
SELECT Count(*) FROM (SELECT * FROM sysobjects)
This will work:
Select Count(*)
From (Select * From sysobjects) as tblJust stick an "as tblName" clause regardless of whether you use it.
In the future please post Microsoft SQL Questions to the MSSQL Forum.
![]() |
Similar Threads
- Small Browser Problem - Urgent (HTML and CSS)
- A BIOS problem? My computer randomly shuts down. (Windows NT / 2000 / XP)
- page access problem (HTML and CSS)
- Small Database Problem (VB.NET)
- Windows server 2003 User creation problem (Windows NT / 2000 / XP)
- BIG problem with STL List Container (C)
- Extremly Small Icons (Windows NT / 2000 / XP)
- Driver Problem with Motherbored? (Troubleshooting Dead Machines)
Other Threads in the MS SQL Forum
- Previous Thread: Help with the Following Logic
- Next Thread: Need help on data addition
| Thread Tools | Search this Thread |
.net 3.5 2008 access ajax app array asp autocomplete autosuggest c# c++ connection count cursor data database delphi derby developer development display dropdown editor extensions hacker hint images integration java jsp linux loop maximum microsoft mining ms msaccess msdn netbeans news number office oracle php play qt query read record remote report result security server sets sharepoint sms software sophos sql sqlserver sqlserver2005 survey update upload uploadatextfile vb.net video view vista warehouse web







