dbTalk Databases Forums  

need help on sql query

comp.database.oracle comp.database.oracle


Discuss need help on sql query in the comp.database.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
longhorntx
 
Posts: n/a

Default need help on sql query - 03-22-2005 , 09:39 AM






hi,
I have a following table data-

city region issue value
c1 north i1 y
c1 north i2 y
c2 north i1 n
c2 north i2 y
c3 south i1 y
c3 south i2 n
c4 east i1 n
c4 east i2 n

This table has value for each issue in every city.
How can I create a report from this which looks like-

region issue count(yes)
north i1 2
north i2 1
south i1 1
south i2 0
east i1 0
east i2 0


Please help/ideas for sql query


Reply With Quote
  #2  
Old   
Fiddler
 
Posts: n/a

Default Re: need help on sql query - 03-25-2005 , 03:14 AM






select region, issue, count(*) from <table> where value = y
union
select region, issue, count(*) from <table> where value = n


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.