
26/09/2008, 02:13
|
| | Fecha de Ingreso: febrero-2007
Mensajes: 1.292
Antigüedad: 18 años, 1 mes Puntos: 13 | |
Respuesta: Buscar una palabra en postgres y saber donde la encontro Puedes probar algo asi:
Código:
select * from (
select id,
CASE WHEN titulo ilike '%hola%' THEN titulo ELSE null END as titulo,
CASE WHEN noticias ilike '%hola%' THEN noticias ELSE null END as noticias,
CASE WHEN texto ilike '%hola%' THEN texto ELSE null END as texto
from tabla
) foo
where foo.titulo is not null
or foo.noticias is not null
or foo.texto is not null
Nos cuentas.
Salu2 |