Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 16th, 2012  |  syntax: None  |  size: 0.31 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. SELECT p.prod_name as Denumire_Produs, sum(c.unit_cost) as Total_Cost,
  2.   dense_rank() over (order by sum(c.unit_cost)desc)as Pozitie
  3.   FROM products p,costs c,times t
  4.   WHERE p.prod_id=c.prod_id
  5.   and t.time_id=c.time_id
  6.   and t.calendar_month_desc IN ('1999-10','1999-11','1999-12')
  7.   GROUP BY p.prod_name;