This discussion is archived
6 Replies Latest reply: Apr 3, 2012 2:42 PM by Woyswer RSS

Help required with SQL Query

Woyswer Newbie
Currently Being Moderated
I have three tables as listed below

FORMAT -- Columns are format_id, format_desc
VIDEO_FORMAT -- columns areVIDEO_FORMAT_ID, VIDEO_ID, FORMAT_ID,COST
RENTAL -- Coulmns are RENTAL_ID, DATE_OUT, DATE_DUE, DATE_IN, DELIVERY_STATUS, LATE_FEE, CUSTOMER_ID, VIDEO_FORMAT_ID

I need to find List customer id, format description and cost of video format for those customers who rented a video.

I wrote the query

Select r.customer_id, f.format_desc, vf.cost from rental r, format f,video_format vf where f.format_id in (select format_id from video_format) and r.video_format_id = vf.video_format_id

this is not fetching exact results. Please help.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points