MySQL Forums
Forum List  »  Stored Procedures

How can i use “select distinct” and have a range for my rows
Posted by: arash beterkun
Date: December 10, 2012 11:20PM

i wrote these codes for pl/sql developer and was wonder how should i insert some ranges as my rows in the " select distinct" columns.

my codes :

select count (t.aaa), sum (t.bbb)
from xxx t
where t.qqq IN ('3')
and t.www like 'A'
and t.eee >= TO_DATE('2008/03/20','YYYY/MM/DD')
and t.eee <= TO_DATE('2009/03/21','YYYY/MM/DD')
and t.ttt >= 10 and t.ttt <= 20
what i need is :

1 - I need the (count (t.aaa) and sum (t.bbb)) as my columns with t.www counter.
like (A,B,C,D). i mean the A has 2 columns and B has 2 columns and ... . every
counter has 2 columns.
2 - and I need the t.ttt ranges in my rows . line (10-20 , 21-30 , 31-40)


help and write a sample for me. thx.



Edited 1 time(s). Last edit at 12/10/2012 11:21PM by arash beterkun.

Options: ReplyQuote


Subject
Views
Written By
Posted
How can i use “select distinct” and have a range for my rows
2143
December 10, 2012 11:20PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.