{"id":1476,"date":"2012-07-09T21:52:58","date_gmt":"2012-07-10T02:52:58","guid":{"rendered":"http:\/\/www.dpriver.com\/blog\/?page_id=1476"},"modified":"2012-07-10T01:54:46","modified_gmt":"2012-07-10T06:54:46","slug":"oracle-sql-query-rewrite-or-clause-to-union-all-statement","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-or-clause-to-union-all-statement\/","title":{"rendered":"Oracle SQL Query rewrite: OR clause to UNION ALL statement"},"content":{"rendered":"

OR clause to UNION ALL statement<\/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  ( status = 'R' OR status = 'E' )\r\nAND    request_date >= SYSDATE - 1 ;\r\n<\/pre>\nSQL will be translated into:<\/p>\n\r\nSELECT *\r\nFROM   fnd_concurrent_requests\r\nWHERE  status = 'R'\r\n       AND request_date >= SYSDATE - 1\r\nUNION ALL\r\nSELECT *\r\nFROM   fnd_concurrent_requests\r\nWHERE  status = 'E'\r\n       AND request_date >= SYSDATE - 1 \r\n<\/pre>\nDownload this demo: C# version<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"OR clause to UNION ALL statement This is an article of Oracle SQL Query rewrite serials. Take this sql for example: SELECT * FROM fnd_concurrent_requests WHERE ( status = ‘R’ OR status = ‘E’ ) AND request_date >= SYSDATE – 1 ; SQL will be translated into: SELECT * FROM fnd_concurrent_requests WHERE status = ‘R’ AND request_date >= SYSDATE – 1 UNION ALL SELECT * FROM fnd_concurrent_requests WHERE status = ‘E’ AND request_date >= SYSDATE – 1 Download this demo: C# version<\/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