[SOLVED]... AND ((column1 + column2)>0) bad condition?
Hi All,
I'm trying this query, i know that result1+result2 is 0 because it doesn't exists in rne.lgm, so the query should return 0 rows. But instead is returning 1 row.
Can anyone help here :(
SELECT registry.id_registry,
registry.registry_num,
registry.name,
registry.sent_date,
registry.nin,
rne.lgm.d_ctrl_fil,
(CASE WHEN (rne.lgm.resultado1+rne.lgm.resultado2 > 0) THEN 1 ELSE 0 END) AS resolved,
registry.ln_number,
registry.la_number,
registry.resolved_abpsl
FROM registry
LEFT JOIN rne.lgm ON rne.lgm.nsc_f = registry.nin
WHERE ((rne.lgm.resultado1 + rne.lgm.resultado2) > 0)
AND (('' = 'VIOLINO HOR') OR (CAST(registry.nin as char) = 'VIOLINO HOR'))
OR (('' = 'VIOLINO HOR') OR (registry.name LIKE '%VIOLINO%'))
OR (('' = 'VIOLINO HOR') OR (registry.registry_num LIKE '%VIOLINO HOR%'))
ORDER BY registry.sent_date DESC
Edited 2 time(s). Last edit at 01/28/2013 04:19PM by António Rodrigues.
Subject
Written By
Posted
[SOLVED]... AND ((column1 + column2)>0) bad condition?
January 28, 2013 11:45AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.