dúvida com SQL
alguém sabe se tem como eu fazer uma consulta dessa forma:
ao invés de:
´select * from TABELA where CAMPO1=´TEXTO´ or CAMPO2=´TEXTO´´
usar algo tipo:
´select * from TABELA where CAMPO1 or CAMPO2 = ´TEXTO´´
ou:
´select * from TABELA where CAMPO1+CAMPO2 = ´TEXTO´´
ou alguma idéia de concatenar os campos e fazer a checagem com apenas 1 parametro ...
abraços !!
ao invés de:
´select * from TABELA where CAMPO1=´TEXTO´ or CAMPO2=´TEXTO´´
usar algo tipo:
´select * from TABELA where CAMPO1 or CAMPO2 = ´TEXTO´´
ou:
´select * from TABELA where CAMPO1+CAMPO2 = ´TEXTO´´
ou alguma idéia de concatenar os campos e fazer a checagem com apenas 1 parametro ...
abraços !!
Danielrsanches
Curtidas 0
Respostas
Danielrsanches
06/06/2009
finalmente consegui:
select * from TABELA where concat( ifnull(CAMPO1,´´) , ifnull(CAMPO2,´´) , ifnull(CAMPO3,´´) ) like ´¬TEXTO¬´
obrigado a todos !!
abraços !!!
select * from TABELA where concat( ifnull(CAMPO1,´´) , ifnull(CAMPO2,´´) , ifnull(CAMPO3,´´) ) like ´¬TEXTO¬´
obrigado a todos !!
abraços !!!
GOSTEI 0
Danielrsanches
06/06/2009
finalmente consegui:
select * from TABELA where concat( ifnull(CAMPO1,´´) , ifnull(CAMPO2,´´) , ifnull(CAMPO3,´´) ) like ´¬TEXTO¬´
obrigado a todos !!
abraços !!!
select * from TABELA where concat( ifnull(CAMPO1,´´) , ifnull(CAMPO2,´´) , ifnull(CAMPO3,´´) ) like ´¬TEXTO¬´
obrigado a todos !!
abraços !!!
GOSTEI 0