SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL Query using Aqua Data Studio program
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

cpat258
Starting Member

USA
3 Posts

Posted - 11/10/2012 :  17:48:55  Show Profile  Reply with Quote
I have executed three tables in my program. They are MOVIE, VIEWER and RATING. Within the MOVIE table i have MovieID, MovieTitle,IMDB_URL and a couple movie genres. With every MovieTitle there is a date(year only) in it. I have to list all the movies that have been released in 1982 and sort them in alphabetical order. I DO NOT have a release date field in this. However i found out the MovieID of movies. They are 89,214,228,414,423,440,527,629,632,638 and 674) All these MovieID were released in 1982. I came up with a code but it doesn't work. Can somebody help me out here? What am i doing wrong?

SELECT Movietitle FROM Movie WHERE MovieID=('89','214','228','414','423','440','527','629','632','638','674') ORDER BY MovieTitle ASC

Chirag Patel

tkizer
Almighty SQL Goddess

USA
37447 Posts

Posted - 11/10/2012 :  18:17:28  Show Profile  Visit tkizer's Homepage  Reply with Quote
Use IN instead of =

I doubt that's the query your instructor wants you to write though. We would need to see some sample data to help.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

cpat258
Starting Member

USA
3 Posts

Posted - 11/10/2012 :  19:52:04  Show Profile  Reply with Quote
Thanks i got it. Im using wildcard in this

SELECT MovieTitle
FROM Movie
WHERE MovieTitle like '%(1982)'
ORDER BY MovieTitle ASC

Chirag Patel

Edited by - cpat258 on 11/10/2012 19:52:29
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000