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
 General SQL Server Forums
 New to SQL Server Programming
 hello, someone help me

Author  Topic 

john8122
Starting Member

1 Post

Posted - 2007-07-03 : 00:08:55
Hello,
I am very new to SQL program.
I am trying to write a statement.

I have three table's, which I am using.

Table location(the atributtes are csid, city, state)
Table studios ( the attributtes are studioid, studio_name, location)
Table movies (the attributtes are movieid, movietitle, studioid1)

My goal is to display the title of the movie, the city and the state where the studio is located that made the movie, for those studios in California (CA)

Here is the statement which I wrote:

Select movies.movietitle, location.city, location.state
From movies
Inner join location,
On location.csid=studios.location, studios.studioid=movies.studiosid1
where location.state= 'CA';


Can anyone tell me where I went wrong with my statement? The SQL program said that I made an error.

Thank! I hope someone able help me!

pbguy
Constraint Violating Yak Guru

319 Posts

Posted - 2007-07-03 : 00:15:42
Select movies.movietitle, location.city, location.state
From movies
join studios
On movies.studiosid1 = studios.studioid
join location
on studios.location = location.csid
where location.state= 'CA'

--------------------------------------------------
S.Ahamed
Go to Top of Page
   

- Advertisement -