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.
| Author |
Topic |
|
steveoz32
Starting Member
3 Posts |
Posted - 2007-10-11 : 07:22:26
|
| Hi All,First off sorry for my complete lack of experience with SQL, but I've just started a new position which involved learning SQL. I'm currently looking for a course but in the mean time I just have to try and fumble by doing basic things.I'm trying to write my first basic select / join statement, and I just can't seem to get it working.Any help would really be appreciated. It's T-SQL we use btw.Thanks :)USE MLSDHeatGOselect * from dbo.CallLogwhere callstatus between 'open'and 'pending'right outer join dbo.Asgnmnton callid = callidorder by callid--the above returns error Msg 156, Level 15, State 1, Line 4Incorrect syntax near the keyword 'right'. |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2007-10-11 : 07:30:23
|
| Books On Line is your best bet to learn how to write basic queriesselect a.callid,b.col1,b.col2,b.col3,etc. from dbo.CallLog aright outer join dbo.Asgnmnt bon a.callid = b.callidwhere a.callstatus IN ('open','pending')order by a.callidJim |
 |
|
|
steveoz32
Starting Member
3 Posts |
Posted - 2007-10-11 : 07:54:24
|
quote: Originally posted by jimf Books On Line is your best bet to learn how to write basic queriesselect a.callid,b.col1,b.col2,b.col3,etc. from dbo.CallLog aright outer join dbo.Asgnmnt bon a.callid = b.callidwhere a.callstatus IN ('open','pending')order by a.callidJim
Spot on thanks very much :) So I had the where statement in the wrong place and the callid field was ambiguous. Got it now.(sorry about the double post wasn't sure I posted in the right place) |
 |
|
|
|
|
|
|
|