Page 1 of 1

select with left join and null values

Posted: Mon Mar 28, 2005 6:53 am
by pelegk2
when i make a select using LEFT JOIN
i recive on some rows null - which is ok!
can i instead of the null write a string of my own?
that in case of a null value write for example "zzz"?
thnaks in adane
peleg

Posted: Mon Mar 28, 2005 7:10 am
by n00b Saibot
check for NULL where you output the data and replace it with the string of youe choice.

how can i do this

Posted: Mon Mar 28, 2005 9:14 am
by pelegk2
as part of the sql syntax

Posted: Mon Mar 28, 2005 9:34 am
by phpScott
no as part of you php synatx when creating the hmtl

yes you can

Posted: Tue Mar 29, 2005 1:25 am
by pelegk2
new things i have learned

Code: Select all

SELECT distinct P_makat_RAW,prod_name,if (tblweightstations.set_no is null,'99',tblweightstations.set_no) as station_num FROM uniprod.tblweighing..............

Posted: Tue Mar 29, 2005 2:17 am
by CoderGoblin
I assume you use MySQL so this will not help you. This is only (as far as I know) for Postgres users and I am writing it here for any others reading this who may be using that database system. Postgres has a command called coalesce, the description of which may be found here. http://www.postgresql.org/docs/7.4/inte ... ional.html

ok

Posted: Tue Mar 29, 2005 3:26 am
by pelegk2
good to know anyway