How to show 0 when no row found

Posted by user1685991 on Stack Overflow See other posts from Stack Overflow or by user1685991
Published on 2012-09-24T09:31:56Z Indexed on 2012/09/24 9:37 UTC
Read the original article Hit count: 189

Filed under:
|

I have a SQL query in which I am passing sysdate to the query problem is that when there is no matching date in table with sysdate then it don't shows the zero even if there is nvl applied here is my query

select * from molasses
where trunc(trn_dte) = trunc(sysdate)

But it show data only when current date is present in table but I want to show zero if no data found in table.please help me to do this in oracle 10 g. Because some times the situation is like above and I have to display zero when no data found

© Stack Overflow or respective owner

Related posts about sql

Related posts about Oracle