[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: [sqr-users] Order by the values obtained in the amount columns
- Subject: Re: [sqr-users] Order by the values obtained in the amount columns
- From: ashwin reddy <ashwin443@yahoo.co.uk>
- Date: Wed, 7 Mar 2007 02:17:09 +0000 (GMT)
- Delivery-date: Tue, 06 Mar 2007 21:19:40 -0500
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.uk;h=Message-ID:X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding;b=qicqXdY4i67iihhWZcdP5/wMg9qkeFF9aOx6tvv71V6gqmfq+ZiD8M/CJXAG4uvf/kbBA+QtBV7aKb6e6NsQAANdFI40fXKMKEXQV3cJyR7pZzHB6WwHPWmN05AA0p6/X2BD8aO2Nu/GQ0s6M013hUkF0oE84FL1Mt3IxgbtDcA=;
- In-reply-to: <s5edd069.086@gwia203.syr.edu>
- List-id: "This list is for discussion about the SQR database reportinglanguage from Hyperion Solutions." <sqr-users.sqrug.org>
thanks alot .... i will try to use mutliple selects or by using arrays and
dumpin it back when printing ......
Larry Roux <lroux@syr.edu> wrote:
The best method would be to use multiple selects. ie
select cust_name , item_amt , billable_flg
from ps_xxx
where billable_flg = 'N' and item_amt > 0
order by cust_name, item_amt
then
select cust_name , item_amt , billable_flg
from ps_xxx
where billable_flg = 'N' and item_amt = 0
order by cust_name
then
select cust_name , item_amt , billable_flg
from ps_xxx
where billable_flg = 'Y'
order by cust_name, item_amt
There are probably a few ways to use creative SQL, but they would be
less efficient and slower - not to mention using up lots of memory on
your RDBMS box
Larry Roux
Information Systems
Syracuse University
lroux@syr.edu
>>> ashwin443@yahoo.co.uk 03/06/07 5:45 PM >>>
I am having a small problem in figurin this out maybe someone has done
this before
Here is my problem ..... here is the sql i have written
select cust_name , item_amt , billable_flg
from ps_xxx
where ....
order by billable_flg desc , cust_name
The output will order by billable_flg and customer name .... here is
the result of the output
billable_flg name item_amt
Y A..... 123.22
Y B.... 0.00
Y C.... 21.00
N A.... 213.22
N B.... 321.22
what i am finally supposed to do is ....to put all the item_amt which
are equal to zero at the end but just before the billable_flg is changed
to 'N' from 'Y'
final output required
billable_flg name item_amt
Y A..... 123.22
Y C.... 21.00
Y B.... 0.00
N A.... 213.22
N B.... 321.22
any ideas on how to do it ...even if u know some order by syntaxes
that i can try let me know i can test it on my query
Thanks,
Ashwin
---------------------------------
New Yahoo! Mail is the ultimate force in competitive emailing. Find out
more at the Yahoo! Mail Championships. Plus: play games and win prizes.
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users
---------------------------------
All New Yahoo! Mail – Tired of unwanted email come-ons? Let our SpamGuard
protect you.
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users