Search Postgresql Archives

Re: regarding select into

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



surabhi.ahuja@xxxxxxxxxxx ("surabhi.ahuja") wrote in 
news:967CFC4343BF2A4DAFACD026D33DC85118EC70@xxxxxxxxxxxxxxx:

>  Hello,
>  
> Is it not possible to write such an sql statement:
>  
> select ser into val1, count(*) into val2 from tab1 where id = $1;
>  
> do i need to perform the 2 selects separately ..wont that impact the 
performance?
>  
> in the table tab1, id is the primary key.
>  

Pleas don't attach html to your e-mails. 
(Normally you should be able to turn that functionality off).

Your question might be unclear.
I might be wrong but is it a PG/pgSQL funtion you are writing?

In that case i think you can use:

select into val1,val2 ser,count(*) from tab1 where id = $1;

(found in chapter "37.6.2 Select into" in my 7.4.2 documentation:

-- 
Rolf

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux