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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 query help

Author  Topic 

jaskalirai
Starting Member

31 Posts

Posted - 2007-12-08 : 11:30:53
select a.au_lname, b.au_ord
from
(select au_lname from authors group by au_lname)
as a inner join
(select au_ord from titleauthor)
as b on a.au_id=b.au_id

my above statement does not work i get the following error messages

Msg 207, Level 16, State 1, Line 6
Invalid column name 'au_id'.
Msg 207, Level 16, State 1, Line 6
Invalid column name 'au_id'.

dataguru1971
Master Smack Fu Yak Hacker

1464 Posts

Posted - 2007-12-08 : 11:38:25
[code]
select a.au_lname, b.au_ord
from
(select au_id,au_lname from authors group by au_lname)
as a inner join
(select au_id,au_ord from titleauthor)
as b on a.au_id=b.au_id
[/code]

you have to select those columns in order to join on them.



Poor planning on your part does not constitute an emergency on my part.

Go to Top of Page

jaskalirai
Starting Member

31 Posts

Posted - 2007-12-08 : 11:42:51
oh yeah kool thanks man !!!
Go to Top of Page
   

- Advertisement -