Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

nrao wwwxxx, xxxxxdup, procmail change subject header, wwwXxx not20, Wwwxxx.doks sas, linux raid resync after reboot, bind-address mysql multiple, sanibleone xxxx, ftp://192.168.100.100/, www.xxxcon

Links

XODOX
Impressum

#1: empty set

Posted on 2011-04-26 09:24:31 by Rocio Gomez Escribano

------=_NextPart_000_0007_01CC03F3.C0C56540
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

Hi! I'm not sure it would be possible what I want to.



I have a huge query, most of them are independent, and they could have not
answer. What I want is when this happen, I want to change the "empty set" by
"void" or "0" or something like that, here it is an example:



mysql> select * from usuarios;
+-----------+--------+
| usuarioID | codigo |
+-----------+--------+
| 1 | 456 |
| 2 | 789 |
| 3 | 123 |
+-----------+--------+
3 rows in set (0.00 sec)



mysql> SELECT usuarioID FROM usuarios WHERE codigo = 45;
Empty set (0.00 sec)





+-----------+
| usuarioID |
+-----------+
| Void |
+-----------+



Is it possible???



Thank you!!


------=_NextPart_000_0007_01CC03F3.C0C56540--

Report this message

#2: Re: empty set

Posted on 2011-04-26 15:01:54 by joao

As far as I know, it isn´t possible.

The right way is to check how many rows your select has returned.

--
João Cândido de Souza Neto

""Rocio Gomez Escribano"" <r.gomez@ingenia-soluciones.com> escreveu na
mensagem
news:000601cc03e2$fd3c9540$f7b5bfc0$@gomez@ingenia-solucione s.com...
> Hi! I'm not sure it would be possible what I want to.
>
>
>
> I have a huge query, most of them are independent, and they could have not
> answer. What I want is when this happen, I want to change the "empty set"
> by
> "void" or "0" or something like that, here it is an example:
>
>
>
> mysql> select * from usuarios;
> +-----------+--------+
> | usuarioID | codigo |
> +-----------+--------+
> | 1 | 456 |
> | 2 | 789 |
> | 3 | 123 |
> +-----------+--------+
> 3 rows in set (0.00 sec)
>
>
>
> mysql> SELECT usuarioID FROM usuarios WHERE codigo = 45;
> Empty set (0.00 sec)
>
>
>
>
>
> +-----------+
> | usuarioID |
> +-----------+
> | Void |
> +-----------+
>
>
>
> Is it possible???
>
>
>
> Thank you!!
>
>



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Report this message

#3: RE: empty set

Posted on 2011-04-26 15:34:57 by Rocio Gomez Escribano

Thank you so much!! It works!!

=09


mysql> SELECT COUNT(*) usuarios,codigo FROM usuarios WHERE codigo =3D =
45;
+----------+--------+
| usuarios | codigo |
+----------+--------+
| 0 | NULL |
+----------+--------+
1 row in set (0.00 sec)



-----Mensaje original-----
De: Jo=E3o C=E2ndido de Souza Neto [mailto:joao@consultorweb.cnt.br]=20
Enviado el: martes, 26 de abril de 2011 15:02
Para: mysql@lists.mysql.com
Asunto: Re: empty set

As far as I know, it isn=B4t possible.

The right way is to check how many rows your select has returned.

--=20
Jo=E3o C=E2ndido de Souza Neto

""Rocio Gomez Escribano"" <r.gomez@ingenia-soluciones.com> escreveu na=20
mensagem=20
news:000601cc03e2$fd3c9540$f7b5bfc0$@gomez@ingenia-solucione s.com...
> Hi! I'm not sure it would be possible what I want to.
>
>
>
> I have a huge query, most of them are independent, and they could have =
not
> answer. What I want is when this happen, I want to change the "empty =
set"=20
> by
> "void" or "0" or something like that, here it is an example:
>
>
>
> mysql> select * from usuarios;
> +-----------+--------+
> | usuarioID | codigo |
> +-----------+--------+
> | 1 | 456 |
> | 2 | 789 |
> | 3 | 123 |
> +-----------+--------+
> 3 rows in set (0.00 sec)
>
>
>
> mysql> SELECT usuarioID FROM usuarios WHERE codigo =3D 45;
> Empty set (0.00 sec)
>
>
>
>
>
> +-----------+
> | usuarioID |
> +-----------+
> | Void |
> +-----------+
>
>
>
> Is it possible???
>
>
>
> Thank you!!
>
>=20



--=20
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/mysql?unsub=3Dr.gomez@ingenia-solucio nes.com




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg

Report this message