dimanche 26 juin 2016

Output results in a single table in console

I'm running the below code using POSTGRESQL in Jetbrains. I'm trying to output the results in a neat 2 column table (QUARTER, RESULTS) INSIDE the console. When I run the below code, it comes back, but in separate tables, making it annoying to have to consolidate the results from each. Is there a way to get multiple results in the same table so I can copy and paste the results INSIDE the console? Thank you

I'm running

SELECT COUNT(DISTINCT  CUSTOMER)  as Q216 FROM(
SELECT  *
FROM    TABLE
WHERE CUSTOMER IN ( SELECT   CUSTOMER
                           FROM     temp_08.Unemployment
                           WHERE TRANSACTION_DATE > '3/31/2016'))



SELECT COUNT(DISTINCT  CUSTOMER)  as Q116 FROM(
SELECT  *
FROM    temp_08.COF
WHERE CUSTOMER IN ( SELECT   CUSTOMER
                           FROM     temp_08.Unemployment
                           WHERE TRANSACTION_DATE between '12/31/2015' and '3/31/2016'))

Aucun commentaire:

Enregistrer un commentaire