Groups | Blog | Home
all groups > sql server new users > december 2005 >

sql server new users : Simple select


Stu
12/1/2005 11:28:15 AM
I think this is what you want:

SELECT id FROM Cases
WHERE Cases.tempcaselogid IN (SELECT tempcaselogid
FROM CaseComments)

Of course, you could accomplish that with a JOIN; why do you not want
to?

HTH,
Stu
Aleks
12/1/2005 1:38:45 PM
What is this statement missing ?

SELECT id FROM Cases WHERE Cases.tempcaselogid = CaseComments.tempcaselogid

I get this error:

Server: Msg 107, Level 16, State 3, Line 1
The column prefix 'CaseComments' does not match with a table name or alias
name used in the query.

I need to use "WHERE" and not a "JOIN"

Aleks

AddThis Social Bookmark Button