![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
05/04/2012, 09:40
|
![Avatar de Agusx1211](http://static.forosdelweb.com/customavatars/avatar325745_1.gif) | | | Fecha de Ingreso: octubre-2009 Ubicación: Buenos Aires
Mensajes: 33
Antigüedad: 15 años, 4 meses Puntos: 2 | |
Respuesta: Convinar AND y OR en mysql por ahora se me ocurrio solucionarlo usando esto:
(SELECT * FROM `eventos` WHERE id_usuario = 1 and time_fin < 7000 and time_fin > 300 and `id_casilla` = 2)
UNION
(SELECT * FROM `eventos` WHERE id_usuario = 1 and time_fin < 7000 and time_fin > 300 and `id_casilla` = 3)
UNION
(SELECT * FROM `eventos` WHERE id_usuario = 1 and time_fin < 7000 and time_fin > 300 and `id_casilla` = 5)
pero me parece que es un poco bestia (no estoy acostumbrado a trabajar con Mysql xd).
Tienen una alternativa mas eficiente para lo mismo? o una consulta mas corta? |