[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


sql7 what's wrong with this statement?

Posted on 2005-04-19
Medium Priority
Last Modified: 2010-03-19
I'm running this in SQL Query Analyzer. I've trimmed it down to a very basic version but I'm still getting the same error:

select callid
from (
   select callid, callopr
   from hdwcall
   where status = 'open'

Server: Msg 170, Level 15, State 1, Line 6
Line 6: Incorrect syntax near ')'.
Question by:alanbergin
LVL 23

Accepted Solution

adathelad earned 200 total points
ID: 13814221
You need to give the nested query an alias:

select callid
from (
   select callid, callopr
   from hdwcall
   where status = 'open'
) SomeTable

Author Comment

ID: 13814275
Nice one. Thank you!

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Suggested Courses

868 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question