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 |
|
DARSHAN
Starting Member
2 Posts |
Posted - 2010-09-08 : 11:34:30
|
| 3a. Obtain the cast list for 'Casablanca'. Use the id value that you obtained in the previous question. actor(id, name)casting(movieid, actorid, ord)id = 27 I wrote select name from actor join casting on (actor.id=casting.movieid) where id = 27but it says wrong.please,write the correct query. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
DARSHAN
Starting Member
2 Posts |
Posted - 2010-09-08 : 11:50:47
|
| i updated my response.please,somebody give me correcr query. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-09-08 : 14:18:26
|
| Homework? Seems to be a lot of that going around lately.If so, may I suggest you go back to your coursework and revise the section on joins--Gail ShawSQL Server MVP |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
Transact Charlie
Master Smack Fu Yak Hacker
3451 Posts |
Posted - 2010-09-08 : 16:13:30
|
There isn't an ID on the casting table so your where clause will actually be filtering on actor.IdIf you are asking this level of question and having this much difficulty you need to go back and study the basics. You query should probably look likeSELECT a.[name] AS [Actor Name]FROM casting AS c JOIN actor AS a ON a.[id] = c.[actorid]WHERE c.[movieid] = 27 (Note this sql is transact specific take out the square brackets and it'll work on most anything (probably))Charlie===============================================================Msg 3903, Level 16, State 1, Line 1736The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION |
 |
|
|
|
|
|
|
|