Re: [mysql] Re: SELECT to return 0 instead of NULL?

2008-05-23 Thread Tuc at T-B-O-H.NET
> > On Fri, May 23, 2008 at 8:23 AM, Tuc at T-B-O-H.NET <[EMAIL PROTECTED]> wrote: > > Hi, > > > >I'm running a query : > > > > SELECT SUM(AcctSessionTime) FROM radacct WHERE UserName='hotspot'; > > > >But if there aren't any rows in "radacct" for the UserName of > > "hotspot", it

Re: SELECT to return 0 instead of NULL?

2008-05-23 Thread Rob Wultsch
On Fri, May 23, 2008 at 8:23 AM, Tuc at T-B-O-H.NET <[EMAIL PROTECTED]> wrote: > Hi, > >I'm running a query : > > SELECT SUM(AcctSessionTime) FROM radacct WHERE UserName='hotspot'; > >But if there aren't any rows in "radacct" for the UserName of > "hotspot", it returns a NULL. Is th

SELECT to return 0 instead of NULL?

2008-05-23 Thread Tuc at T-B-O-H.NET
Hi, I'm running a query : SELECT SUM(AcctSessionTime) FROM radacct WHERE UserName='hotspot'; But if there aren't any rows in "radacct" for the UserName of "hotspot", it returns a NULL. Is there a way to change it to return 0 instead? (I can't change the application, but I can cha