From: | Alban Hertroys <alban(at)magproductions(dot)nl> |
---|---|
To: | "surabhi(dot)ahuja" <surabhi(dot)ahuja(at)iiitb(dot)ac(dot)in> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: regarding select into |
Date: | 2005-09-26 09:04:39 |
Message-ID: | 4337B9A7.8070607@magproductions.nl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
surabhi.ahuja wrote:
> 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?
Well, considering id is your primary key and therefore very probably
unique, you could as well do: select ser, 1 from tab1 where id=$1;
Otherwise, whatever interface you're using is likely to have a rowcount
value for you.
If that's not what you're looking for, please don't make us guess what
you want to achieve.
--
Alban Hertroys
alban(at)magproductions(dot)nl
magproductions b.v.
T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
7500 AK Enschede
//Showing your Vision to the World//
From | Date | Subject | |
---|---|---|---|
Next Message | pobox@verysmall.org | 2005-09-26 11:02:38 | RI_ConstraintTrigger question |
Previous Message | Csaba Nagy | 2005-09-26 08:15:38 | Re: Slow connection to the database |