2

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

1
  • If you found my answer helpful then could you accept it using checkmark? Commented Oct 5, 2017 at 17:35

1 Answer 1

3

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;
Sign up to request clarification or add additional context in comments.

1 Comment

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.