Home All Groups Group Topic Archive Search About
Author
1 Dec 2005 6:39 PM
Aleks
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

Author
1 Dec 2005 6:49 PM
Trey Walpole
What do you mean by you need to use WHERE instead of JOIN?

You need to use a join in order to include the CaseComments table, which
has not been specified as a source table for the query.

Aleks wrote:
Show quote
> 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
>
>
Author
1 Dec 2005 6:52 PM
Raymond D'Anjou
Hi Aleks,
If you're new to newsgroups I forgive you.
Please don't multi-post.
You posted the same question in sqlserver.newusers
Some people may waste their time answering when it's already been answered
in the other newsgroup when their time would have been better spent on
another question.
You MAY crossgroup to a very limited number (2 max).
That way, we will see answers from both newgroups.
In this case, one of the 2 groups would have been sufficient.

Show quote
"Aleks" <arkark2***@hotmail.com> wrote in message
news:e5FkOaq9FHA.1188@TK2MSFTNGP12.phx.gbl...
> 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
>
Author
1 Dec 2005 6:57 PM
Sericinus hunter
Add CaseComments to FROM clause:

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

Aleks wrote:
Show quote
> 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
>
>
Author
1 Dec 2005 10:27 PM
Hugo Kornelis
On Thu, 1 Dec 2005 13:39:11 -0500, Aleks wrote:

>What is this statement missing ?
(snip)

Hi Aleks,

I answered this question, just as the previous question, in
microsoft.public.sqlserver.newusers.

Please don't multi-post!!

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)

AddThis Social Bookmark Button