{"id":1480,"date":"2012-07-09T21:54:57","date_gmt":"2012-07-10T02:54:57","guid":{"rendered":"http:\/\/www.dpriver.com\/blog\/?page_id=1480"},"modified":"2012-07-10T02:12:16","modified_gmt":"2012-07-10T07:12:16","slug":"oracle-sql-query-rewrite-re-write-suppressed-joined-columns-in-the-where-clause","status":"publish","type":"page","link":"https:\/\/www.dpriver.com\/blog\/list-of-demos-illustrate-how-to-use-general-sql-parser\/oracle-sql-query-rewrite\/oracle-sql-query-rewrite-re-write-suppressed-joined-columns-in-the-where-clause\/","title":{"rendered":"Oracle SQL Query rewrite: Re-write suppressed joined columns in the WHERE clause"},"content":{"rendered":"

Re-write suppressed joined columns in the WHERE clause<\/p>\n

Columns suppressed by various functions and concatenations should be re-written in other syntax.<\/p>\n

This is an article of Oracle SQL Query rewrite serials<\/a>.<\/p>\n

Take this sql for example:<\/p>\n

    \r\nSELECT *\r\nFROM   fnd_concurrent_requests\r\nWHERE  TO_CHAR(request_date, 'YYYYMMDD') = '20080520' \r\nAND    status_code = 'E'\r\nAND    phase_code  = 'C' ;\r\n<\/pre>\nSQL will be translated into:<\/p>\n\r\nSELECT *\r\nFROM   fnd_concurrent_requests\r\nWHERE  request_date >= To_date('20080520', 'YYYYMMDD')\r\n       AND request_date < To_date('20080520', 'YYYYMMDD') + 1\r\n       AND status_code = 'E'\r\n       AND phase_code = 'C' \r\n<\/pre>\nDownload this demo: C# version<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"Re-write suppressed joined columns in the WHERE clause Columns suppressed by various functions and concatenations should be re-written in other syntax. This is an article of Oracle SQL Query rewrite serials. Take this sql for example: SELECT * FROM fnd_concurrent_requests WHERE TO_CHAR(request_date, ‘YYYYMMDD’) = ‘20080520’ AND status_code = ‘E’ AND phase_code = ‘C’ ; SQL will be translated into: SELECT * FROM fnd_concurrent_requests WHERE request_date >= To_date(‘20080520’, ‘YYYYMMDD’) AND request_date < To_date('20080520', 'YYYYMMDD') + 1 AND status_code = 'E' AND phase_code = 'C' Download this demo: C# version\n<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1445,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"gsp_feature_page_tt.php","meta":[],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":5}},"yoast_head":"\nHelp you to make better use of General SQL Parser<\/title>\n\n\n\n\n\n\n\n\n\n\n\n