Re: Get a Numeric Zero instead of NULL in SELECT

2006-08-14 Thread Michael Stassen
Asif Lodhi wrote: Hi, I have a query: INSERT INTO tmp2 (x) SELECT ((t3.m * 100) + b.id) AS x2 FROM tmp3 t3 LEFT JOIN (SELECT (MAX(x) - ((MAX(x) div 100) * 100)) + 1 AS pid FROM tmp2 WHERE (x div 100) = 2147 HAVING (MAX(x) - ((MAX(x) div 1

Re: Get a Numeric Zero instead of NULL in SELECT

2006-08-10 Thread Brent Baisley
The only way to force a numeric zero instead of a NULL is to alter the table. Don't allow NULL's in the field and set a default value of 0. However, you then lose the ability to determine is a value was actually entered or if 0 was entered. Don't know if that matter to you. Otherwise, you can u

Re: Get a Numeric Zero instead of NULL in SELECT

2006-08-10 Thread Asif Lodhi
Hi, I am replying to my own post to tell you that now I am using CASE WHEN {condition} THEN END construct to check for NULL and returning numeric ZERO. On the face of it, CASE doesn't seem to be function - it's an operator - isn't? However, I would now like to ask you