Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

oracle search

Tuesday, August 12, 2008

Bracketing frenzy ....oracle

I just found myself decyphering this:

SELECT ...
FROM report_results rpt
WHERE NOT ( (substr(rpt.report_type,2,1) in ('1','2','3','4','5')) and
(rpt.sig_type = 'ISDNMA') and
((rpt.group_ctn != rpt.ctn_prefix||rpt.ctn_suffix) and
(length(rpt.group_ctn) != length(rpt.ctn_prefix||rpt.ctn_suffix)) and
((length(rpt.group_ctn) != (length(rpt.ctn_prefix||rpt.ctn_suffix)-1)
))));

Which turns out to mean this:

SELECT ...
FROM report_results rpt
WHERE NOT ( SUBSTR(rpt.report_type,2,1) IN ('1','2','3','4','5')
AND rpt.sig_type = 'ISDNMA'
AND rpt.group_ctn != rpt.ctn_prefix||rpt.ctn_suffix
AND LENGTH(rpt.group_ctn) != LENGTH(rpt.ctn_prefix||rpt.ctn_suffix)
AND LENGTH(rpt.group_ctn) != LENGTH(rpt.ctn_prefix||rpt.ctn_suffix)-1 );

No wonder there are no brackets left in the shops.

No comments: