On Wed, Jan 14, 2009 at 17:56, Mark Styles <postg...@lambic.co.uk> wrote:

>
> SELECT COALESCE(mid,0) AS mid, COALESCE(id_group,0) AS id_group
> FROM users
> WHERE username = 'test'
> UNION
> SELECT 0, 0
> WHERE NOT EXISTS (SELECT 1 FROM users WHERE username = 'test');
>
>
> --
> Mark
> http://www.lambic.co.uk
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFJblF5YAVdOy4CIaIRArhBAKCLS3N+ccaigBiZKuJDOebrmbdlSwCghkYf
> zFX5ktrUMPWB9BV9mg5thKo=
> =g/1b
> -----END PGP SIGNATURE-----
>
>
wow amazing :D that did the trick !!!! :D

I had tried COALESCE but I had not thought at all in an union...

Thanks a lot Mark for your incredible fast and fantastic response !

Greetings ;)


-- 
Mailed by:
UnReAl4U - unreal4u
ICQ #: 54472056
www: http://www.chw.net/

Reply via email to