diff options
author | Jeremy Dorn <jeremy@jeremydorn.com> | 2013-03-20 21:18:34 -0700 |
---|---|---|
committer | Jeremy Dorn <jeremy@jeremydorn.com> | 2013-03-20 21:18:34 -0700 |
commit | fa92df63b164d001a37db5bf1460ef8ce3271a11 (patch) | |
tree | bce18069294e39d6891b3546130ed5647545005f /examples/examples.php | |
parent | 46ec57eb77c2aaf6e685ecb9864ac01a5878cc77 (diff) | |
download | sql-formatter-fa92df63b164d001a37db5bf1460ef8ce3271a11.zip sql-formatter-fa92df63b164d001a37db5bf1460ef8ce3271a11.tar.gz sql-formatter-fa92df63b164d001a37db5bf1460ef8ce3271a11.tar.bz2 |
Improved formatting of inline parentheses. Fixes #32
Added "IFNULL" as a reserved word.
Changed "NOW" to "NOW()" in the reserved word list so it can be used within inline parentheses.
Diffstat (limited to 'examples/examples.php')
-rw-r--r-- | examples/examples.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/examples.php b/examples/examples.php index 41e7f5e..0d3c641 100644 --- a/examples/examples.php +++ b/examples/examples.php @@ -35,6 +35,15 @@ require_once(__DIR__.'/../lib/SqlFormatter.php'); // Example statements for formatting and highlighting $statements = array( + "SELECT DATE_FORMAT(b.t_create, '%Y-%c-%d') dateID, b.title memo + FROM (SELECT id FROM orc_scheme_detail d WHERE d.business=208 + AND d.type IN (29,30,31,321,33,34,3542,361,327,38,39,40,41,42,431,4422,415,4546,47,48,'a', + 29,30,31,321,33,34,3542,361,327,38,39,40,41,42,431,4422,415,4546,47,48,'a') + AND d.title IS NOT NULL AND t_create >= + DATE_FORMAT((DATE_SUB(NOW(),INTERVAL 1 DAY)),'%Y-%c-%d') AND t_create + < DATE_FORMAT(NOW(), '%Y-%c-%d') ORDER BY d.id LIMIT 2,10) a, + orc_scheme_detail b WHERE a.id = b.id", + "SELECT * FROM MyTable WHERE id = 46", "SELECT count(*),`Column1`,`Testing`, `Testing Three` FROM `Table1` |