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

ORA-01017: invalid username/password; logon denied
Dear All,

I am facing problem in taken backup from db13 it comes up with the following l

Check Date/Time in PHP
What I need the code to check is that $reQuest is 24 hours in the past then return a time based on h

Selecting an "empty" date formated field
How do you select an "empty" date field? I've tried the few ways I can think.
SQL> select

get url?
how do i get the url of the page i'm currently on, on my website.. i think its get header.. how do i

Output Buffering question
Hi all,

I've been trying to wrap my head around output buffering. So far I've found tons of

with clause
hi all, i have a big query that usually access the same table more than once. for example, i have s

check_changed_data - I can't get data from the called method event
I use check_changed_data to trigger my event method.

The method delivers er_changed_data.

php or sql?
Sorry not sure if this is a sql problem or php the following code is supposed to delete data from th

Redirecting Admin
In my members table, I have a field called "perm" and it's set to zero for all members. Ho

SQL Injection
In my attempts to protect my database from mySQL injection I have created another problem for myself

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