SQL Tuning‎ > ‎

q3


select distinct * from foo.a, foo.c, foo.d, foo.g
   WHERE a.planted_date = to_date('02/10/2008','dd/mm/yyyy')
     AND a.pears = 'D'
     AND a.green_beans = '1'
     AND a.planted_date = c.planted_date
     AND a.pears = c.pears
     AND a.zuchinis = c.zuchinis
     AND a.brocoli = c.brocoli
     AND a.planted_date = d.planted_date
     AND a.pears = d.pears
     AND a.harvest_size = d.harvest_size
     AND c.oranges = d.oranges
     AND c.apples = d.apples
     AND (d.lemons = 0 OR d.lemons IS NULL)
     AND a.planted_date = g.planted_date
     AND a.pears = g.pears
     AND a.harvest_size = g.harvest_size
     AND c.oranges = g.oranges
     AND c.apples = g.apples
     AND (g.lemons = 0 OR g.lemons IS NULL)
     and a.zuchinis='0236'
ORDER BY a.zuchinis, a.brocoli;

Comments