Skip to main content
13 events
when toggle format what by license comment
Apr 13, 2017 at 12:42 history edited CommunityBot
replaced http://dba.stackexchange.com/ with https://dba.stackexchange.com/
Nov 23, 2016 at 8:25 vote accept Evan Carroll
Nov 18, 2016 at 0:08 history edited Evan Carroll CC BY-SA 3.0
added 4 characters in body
Nov 18, 2016 at 0:06 comment added Evan Carroll Yep! That's totally fair, and should probably never use them. I actually posted this originally on your question but I wasn't sure if I was adding to it, or distracting from it so I broke it off into its own thing.
Nov 17, 2016 at 23:58 comment added Wildcard Ahh, but I'm talking about column aliases for a table name, not for a subselect or a WITH clause. A values call is actually a subselect, not a table. See the two formats for from_item which I list in my question, quoting from the docs. Your comment above applies to the second form (subselects) but not to the first. So my earlier comment could be rephrased: It seems that table_names specified in a FROM clause never need to have column_aliases, as the same effect could always be achieved by using output_names. That suit you? :)
Nov 17, 2016 at 23:40 comment added Evan Carroll @Wildcard that's not safe even if true The column names are not specified by the SQL standard and different database systems do it differently, We're just kind of poking fun at a cool PG-trick.
Nov 17, 2016 at 22:06 comment added jpmc26 UNNESTing an array is another example.
Nov 17, 2016 at 18:47 comment added Wildcard Interesting; so it seems that column aliases in from clauses are never actually needed but may (arguably) be more expressive in some cases.
Nov 17, 2016 at 17:09 comment added Evan Carroll @ypercubeᵀᴹ for real terror, SELECT "?column?" AS f FROM (SELECT 1) AS t
Nov 17, 2016 at 16:29 history edited Evan Carroll CC BY-SA 3.0
deleted 10 characters in body
Nov 17, 2016 at 16:25 history edited Evan Carroll CC BY-SA 3.0
added 612 characters in body
Nov 17, 2016 at 16:19 history edited Evan Carroll CC BY-SA 3.0
added 612 characters in body
Nov 17, 2016 at 16:08 history answered Evan Carroll CC BY-SA 3.0