Re: [GENERAL] Using relations in the SELECT part

2017-03-30 Thread Giuseppe Sacco
Hello Tom, Il giorno mer, 29/03/2017 alle 09.59 -0400, Tom Lane ha scritto: [...] > > Furthermore, let's assume postgres does a cartesian product, if I > > add a > > new relation as third element, does it create 4x3 product? > > You've hit on the reason why it's semantically ugly: it's not very >

Re: [GENERAL] Using relations in the SELECT part

2017-03-29 Thread Tom Lane
Giuseppe Sacco writes: > the solution I found is: > postgres=# select key, > unnest(regexp_split_to_array(plates, E'\\s+')) AS plate from t; > 1. why may I put in the SELECT part (instead of the FROM) a relation? > When I studied SQL, I was told to put all relations in FROM, and put in > the SEL

[GENERAL] Using relations in the SELECT part

2017-03-29 Thread Giuseppe Sacco
Hello, I am writing to this list since I wrote a query that I cannot really understand. So, thanks to anyone who will light my darkness :-) I have a table with two columns, the first one is a key, the second one is a list of car plates. What I need to extract is a result set that contains two colu