2013-01-17 77 views
0

我使用WITH查詢這樣的事情做出了選擇:PostgreSQL的選擇組合2查詢

WITH test AS (select id, sum(value) as value from test group by id) 
SELECT name, t.value from names JOIN test t ON (t.id = names.id) 

但我需要使用2個查詢,有沒有什麼辦法讓它?

回答

0
WITH 
    name1 AS (SELECT ...), 
    name2 AS (SELECT ...) 
SELECT ...