6 Replies Latest reply on Apr 3, 2012 9:56 PM by WannaRock

    Help required with SQL Query

    Woyswer
      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.