query help


Posted on 16th Feb 2014 07:03 pm by admin

Hi experts.

i have a table rep2 like this
PROD_COD ACCT_NO DUE_DAYS BALANCE LIMIT
1 1 101 15 100 200
2 1 102 17 150 200
3 1 103 32 500 1000
4 2 201 30 250 300
5 2 202 60 800 1000
6 3 301 62 900 1500
7 3 302 90 400 800
8 3 303 98 600 1200

and i am running below query on the table

select '720+', prod_cod, count(acct_no), sum(balance), sum(limit)
from rep2
where due_days > 720
group by prod_cod;

but o/p is "0 rows selected".

how to show the o/p like this
720+ , null,0,0,0 .
in other words i want to show the record even if the condition doesn't satisfy.

thanks

No comments posted yet

Your Answer:

Login to answer
330 Like 40 Dislike
Previous forums Next forums
Other forums

Record count of entire database
Does anyone know if there is a way to obtain the number of records in each table of the database usi

start new row of pictures
on my site www.budstreasureauctions.com there is a featured auctions box that users will pay to get

Session problem?!?
Hello All! I am very new to the php world but I am working on fixing things that a previous programm

close site for maintenance
i get a tutorial, saying the following code can put our site offline, and only the developer can vie

shift numbers with paging
Hi

How would i be able to display 10 numbers 1 2 3 4 5 6 7 8 9 10
and when I click next

ECC6 - Single sign-on
We are in the process of upgrading to ECC 6 which will support single sign on with user passwords al

ORA-00932: inconsistent datatypes: expected - got CLOB
SO : windows xp
database : XE

there is a table (transito) with two fields of clob

Need help: how to catch acess of undefined class properties
Hello. I am learning OO with PHP and have hit a problem.
Some code runs as perfectly valid code,

Help With Showing Users On the Index Page
Ive got this code which works just how i want it to.

Code: <?
$timenow=time();

ImageCreate()
When I create an image and add text to it I want my text to be replaced with a PNG image, because th

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash