[GENERAL]

2003-11-09 Thread sgupta5
Hello, Can you please help me in understanding how constants are stored in postgresql and how the Datum data structure is used for the same. Thanks Shalu ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command

[GENERAL] question regarding constant values

2003-11-09 Thread sgupta5
Hello, Can you please help me in understanding how constant values are stored in postgresql. What is the Datum Data Structue and how is it used? Thanks Shalu Gupta ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settin

Re: [GENERAL] SQL-question: returning the id of an insert querry

2003-11-09 Thread Alvaro Herrera
On Sun, Nov 09, 2003 at 10:26:51AM -0800, Scott Chapman wrote: > On Sunday 09 November 2003 03:13, Martijn van Oosterhout wrote: > > After you've done the insert on the address table, you can use > > currval('address_id_seq') (or equivalent) to get the ID. Ofcourse you > > have to have used nextval

Re: [GENERAL] SQL-question: returning the id of an insert querry

2003-11-09 Thread Doug McNaught
Scott Chapman <[EMAIL PROTECTED]> writes: > On Sunday 09 November 2003 03:13, Martijn van Oosterhout wrote: > > After you've done the insert on the address table, you can use > > currval('address_id_seq') (or equivalent) to get the ID. Ofcourse you > > have to have used nextval() for the original

Re: [GENERAL] SQL-question: returning the id of an insert querry

2003-11-09 Thread Scott Chapman
On Sunday 09 November 2003 03:13, Martijn van Oosterhout wrote: > After you've done the insert on the address table, you can use > currval('address_id_seq') (or equivalent) to get the ID. Ofcourse you > have to have used nextval() for the original insert. What if someone else inserts another addre

Re: [GENERAL] Question on Select

2003-11-09 Thread Rajesh Kumar Mallah
select ref_code from tab_b where not exists (select * from tab_a where item_id = tab_b.item_id); make sure u have index on item_id in tab_a . the above sql is quite efficient , other method is to use left join. Alex wrote: Hi, I have two tables, Table A: item_id Table B: item_id, ref_c

[GENERAL] Question on Select

2003-11-09 Thread Alex
Hi, I have two tables, Table A: item_id Table B: item_id, ref_code and i want to list all ref_codes in table B that are not referenced by Table A. Table A has about 3million records./ table B 200 What is the best way to do that ? Thanks Alex ---(end of broadcast)---

Re: [GENERAL] SQL-question: returning the id of an insert querry

2003-11-09 Thread Andreas Fromm
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Martijn van Oosterhout wrote: > After you've done the insert on the address table, you can use > currval('address_id_seq') (or equivalent) to get the ID. Ofcourse you have > to have used nextval() for the original insert. > > Hope this helps, > ..goi

Re: [GENERAL] SQL-question: returning the id of an insert querry

2003-11-09 Thread Martijn van Oosterhout
After you've done the insert on the address table, you can use currval('address_id_seq') (or equivalent) to get the ID. Ofcourse you have to have used nextval() for the original insert. Hope this helps, On Sun, Nov 09, 2003 at 11:29:49AM +0100, Andreas Fromm wrote: > Hi, > > Im building an user

[GENERAL] SQL-question: returning the id of an insert querry

2003-11-09 Thread Andreas Fromm
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, Im building an user database with many tables keeping the data for the Address, Phone numbers, etc which are referenced by a table where I keep the single users. My question is, how do I get the "Id"-value of a newly inserted address to store it i