have a table.. ino confi loc 1 xyz a 1 xyz a 1 xyz v 2 xyz v 2 abc s 2 kg a
i want to generate a report of this form no confi a v s 1 xyz 2 1 - 2 xyz - 1 - 2 abc - - 1 2 lkg 1 - -
note the table values are columns in report.. it wouldbe helpful if u help me out.. bye. rev
Didn't test this, but it should be close:
select ino, confi, sum (case when loc = 'a' then 1 else 0 end) as a, sum (case when loc = 'v' then 1 else 0 end) as v, sum (case when loc = 's' then 1 else 0 end) as s from mytable group by ino,confi