0

Is it that pgadmin 4 does not support the execution of multiple select queries?

I tried executing this query

select cust, prod 
from sales;

select * 
from sales

it only showed me one table

JustCurious
  • 780
  • 1
  • 10
  • 29

1 Answers1

2

You are missing semicolon after first query which is incorrect SQL syntax.

select cust, prod 
from sales;

select * 
from sales;

FYI, do not expect two separate results after executing it in query tool, you will only get result from last query only.

Updates for WITH clause question.

with Min_cust as (
        select cust, max(quant),min(quant) from sales group by cust
    ),
    FinalMin as (
        select sales.cust,sales.prod,minium from sales 
        natural join Min_cust as A where sales.quant=A.min
    ) 
    select * from FinalMin;
Murtuza Z
  • 5,639
  • 1
  • 28
  • 52
  • Thanks that solved the problem. I am also getting an error when i use 2 with queries consecutively. with Min_cust as (select cust, max(quant),min(quant) from sales group by cust); with FinalMin as (select sales.cust,sales.prod,minium from sales natural join Min_cust as A where sales.quant=A.min) select * from FinalMin; can you please help me with this @n33rma – JustCurious Oct 02 '17 at 18:07