4 ms·
I very like the WITH statement in Postgres. It allow to break down the logic and composite the result. Any idea if it's standard SQL?
by rachbelaid 13y ago
I very like the WITH statement in Postgres.
It allow to break down the logic and composite the result.
Any idea if it's standard SQL?
- bigdubs 13y ago[strikeout, see comment above, it's in SQL99] MSSQL has a similar construct with Common Table Expressions (CTE's) though, so it' not unique to PG.
- rachbelaid 13y agoThanks for the details.
- NDizzle 13y agoAnother tip for using WITH on MSSQL - prefix it with semicolon like this: ;WITH MSSQL makes it so that people pick up bad habits over the years and often you'll find missing semicolons at the end of statements. While the parser will intelligently handle missing semicolons for the majority of of scripts, it will bomb 100% of the time (at least up to 2008R2) on WITH.
- bsg75 13y agoIts part of the ANSI SQL-99 standard: http://en.wikipedia.org/wiki/SQL:1999 http://en.wikipedia.org/wiki/SQL:1999