On Wed, Mar 27, 2013 at 9:03 AM, Tom Lane wrote:
> Gavin Flower writes:
>> The rule appears to be,
>> where N_x & N_y are the number of entries returned for x & y:
>> N_result = is the smallest positive integer that has N_x & N_y as factors.
>
> Right: if there are multiple set-returning function
On 2013-03-27, Ken Tanzer wrote:
> --047d7b5da657ecd54004d8e23a90
> Content-Type: text/plain; charset=ISO-8859-1
>
> I've been working on some queries involving multiple unnested columns. At
> first, I expected the number of rows returned would be the product of the
> array lengths, so that this
On 28/03/13 03:03, Tom Lane wrote:
Gavin Flower writes:
The rule appears to be,
where N_x & N_y are the number of entries returned for x & y:
N_result = is the smallest positive integer that has N_x & N_y as factors.
Right: if there are multiple set-returning functions in a SELECT list,
the nu
2013/3/27 Tom Lane :
> Gavin Flower writes:
>> The rule appears to be,
>> where N_x & N_y are the number of entries returned for x & y:
>> N_result = is the smallest positive integer that has N_x & N_y as factors.
>
> Right: if there are multiple set-returning functions in a SELECT list,
> the num
Gavin Flower writes:
> The rule appears to be,
> where N_x & N_y are the number of entries returned for x & y:
> N_result = is the smallest positive integer that has N_x & N_y as factors.
Right: if there are multiple set-returning functions in a SELECT list,
the number of rows you get is the leas
Hi,
You can try:
SELECT c1, c2 FROM
(
WITH a AS
(
SELECT row_number() OVER(),* FROM unnest(array['a','b', 'c', 'd']) c1
),
b AS
(
SELECT row_number() OVER(),* FROM unnest(array['1','2', '3']) c2
)
SELECT * FROM a LEFT JOIN b USING (row_number)
UNION
SELECT * FROM a RIGHT JOIN b USING (row_number)
On 27/03/13 20:36, Ian Lawrence Barwick wrote:
2013/3/27 Ken Tanzer mailto:ken.tan...@gmail.com>>
Basically you are getting Cartesian joins on the row output of
unnest()
Well that's what I expected too. Except look at this example,
after you delete c:
testdb=# DE
2013/3/27 Ken Tanzer
> Basically you are getting Cartesian joins on the row output of
>> unnest()
>
>
> Well that's what I expected too. Except look at this example, after you
> delete c:
>
> testdb=# DELETE FROM t2 where val='c';
> DELETE 1
> testdb=# SELECT * from t1, t2;
> val | val
> -+
>
> Basically you are getting Cartesian joins on the row output of
> unnest()
Well that's what I expected too. Except look at this example, after you
delete c:
testdb=# DELETE FROM t2 where val='c';
DELETE 1
testdb=# SELECT * from t1, t2;
val | val
-+-
1 | a
1 | b
2 | a
2 |
2013/3/27 Ken Tanzer
>
> I've been working on some queries involving multiple unnested columns. At
> first, I expected the number of rows returned would be the product of the
> array lengths, so that this query would return 4 rows:
>
> SELECT unnest2(array['a','b']),unnest2(array['1','2']);
>
>
10 matches
Mail list logo