Re: [SQL] How to process inverted comma in "EXECUTE 'insert into xxx values(...)

2007-05-14 Thread Nemo Terry
But I must use it in function,so... Do you have another solution? From: "Rodrigo De Le�n" <[EMAIL PROTECTED]> To: pgsql-sql@postgresql.org CC: "Nemo Terry" <[EMAIL PROTECTED]> Subject: Re: [SQL] How to process inverted comma in "EXECUTE 'insert into xxx values(...)';"? Date: Tue, 15 May 2007 0

Re: [SQL] How to process inverted comma in "EXECUTE 'insert into xxx values(...)';"?

2007-05-14 Thread Rodrigo De León
On 5/14/07, Nemo Terry <[EMAIL PROTECTED]> wrote: Look at this problem: when execute 'insert into lse_installations values(' || ||obj_id|| || ',' || ||div|| || ',' || ||sub|| || ',' || ||obj_type|| || ',' || ||obj_name|| || ',' || ||pstcd|| || ','

[SQL] How to process inverted comma in "EXECUTE 'insert into xxx values(...)';"?

2007-05-14 Thread Nemo Terry
Look at this problem: when execute 'insert into lse_installations values(' || ||obj_id|| || ',' || ||div|| || ',' || ||sub|| || ',' || ||obj_type|| || ',' || ||obj_name|| || ',' || ||pstcd|| || ',' || ||rdcd|| || ',' || ||blkno|| |

Re: [SQL] Doing a conditional aggregate (e.g. count(*) if x=y) in postgres?

2007-05-14 Thread Bryce Nesbitt
Ah perfect. I was struggling with CASE outside the SUM(), which was not working. ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate

Re: [SQL] Doing a conditional aggregate (e.g. count(*) if x=y) in postgres?

2007-05-14 Thread Geoff Tolley
Bryce Nesbitt wrote: All; Is there a way to get a conditional aggregate? I have this two column view: SELECT count(*) AS count, xx_plan.plan_name FROM xx_membership JOIN xx_account USING (account_id) JOIN xx_plan USING (plan_id) WHERE xx_membership.status = 10 GROUP BY xx_plan.pla

Re: [SQL] Doing a conditional aggregate (e.g. count(*) if x=y) in postgres?

2007-05-14 Thread Jim Buttafuoco
Use case statement and sum to get a count where status=20... For example Select sum(case when status=20 then 1 else 0 end) as status20, Sum(case when status=30 then 1 else 0 end) as status30 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Br

Re: [SQL] pg_dump?

2007-05-14 Thread Paul Lambert
Richard Dunne wrote: PostgreSQL begginer. Whats the best way of exporting(dumping) a database/table/view/query to a file? I am using PostgreSQL v 8.2. I am starting postgres server with C:\WINDOWS\system32\net.exe start pgsql-8.2, (start service) C:\postgresql-8.2.3-1\bin\psql.exe -h localhos

[SQL] Doing a conditional aggregate (e.g. count(*) if x=y) in postgres?

2007-05-14 Thread Bryce Nesbitt
All; Is there a way to get a conditional aggregate? I have this two column view: SELECT count(*) AS count, xx_plan.plan_name FROM xx_membership JOIN xx_account USING (account_id) JOIN xx_plan USING (plan_id) WHERE xx_membership.status = 10 GROUP BY xx_plan.plan_name; And would like

[SQL] pg_dump?

2007-05-14 Thread Richard Dunne
PostgreSQL begginer. Whats the best way of exporting(dumping) a database/table/view/query to a file? I am using PostgreSQL v 8.2. I am starting postgres server with C:\WINDOWS\system32\net.exe start pgsql-8.2, (start service) C:\postgresql-8.2.3-1\bin\psql.exe -h localhost -p 5432 postgres "R

Re: [SQL] How to retrieve a n-ary tree in SQL?

2007-05-14 Thread Rodrigo De León
On 5/14/07, Joost Kraaijeveld <[EMAIL PROTECTED]> wrote: Is there a way to get a query (of function) to retrieve a n-ary tree: 1 parent node has n children and the tree is n levels deep? See: http://search.postgresql.org/search?q=tree&m=1&l=4&d=365&s=r ---(end of broad

Re: [SQL] need help

2007-05-14 Thread Aaron Bono
On 5/14/07, Penchalaiah P. <[EMAIL PROTECTED]> wrote: Hi … Create table cdano_nya(cdano int4,nyano int4) … I created this table and then I inserted some values to this( 234576,86)… Now when I am updating this table .. its not updating ..query is continuously running…

[SQL] How to retrieve a n-ary tree in SQL?

2007-05-14 Thread Joost Kraaijeveld
Hi, Is there a way to get a query (of function) to retrieve a n-ary tree: 1 parent node has n children and the tree is n levels deep? TIA -- Groeten, Joost Kraaijeveld Askesis B.V. Molukkenstraat 14 6524NB Nijmegen tel: 024-3888063 / 06-51855277 fax: 024-3608416 web: www.askesis.nl --

Re: [SQL] Temporal Table Relations and Referential Integrity

2007-05-14 Thread Richard Broersma Jr
--- Michael Glaesemann <[EMAIL PROTECTED]> wrote: > It'd be helpful if you provided links to what you refer to as the > Current style. The only reference for managing temporal data in ANSI > SQL I'm aware of is Snodgrass' "Developing Time-Oriented Database > Applications in SQL"[1]. Date, Da

Re: [SQL] Temporal Table Relations and Referential Integrity

2007-05-14 Thread Michael Glaesemann
On May 7, 2007, at 9:59 , Richard Broersma Jr wrote: However, since temporal UPDATEs and DELETEs do not behave in the same way as they do in non-temporal tables, is anyone able to successfully use Referential Integrity constraints between Parent and Child tables? Or are custom triggers the

Re: [SQL] select ..... not in .....

2007-05-14 Thread Tom Lane
Gary Stainburn <[EMAIL PROTECTED]> writes: > So, who does this select not return the row? > select v_d_code, v_o_number, v_vin, v_status from vista_details where v_vin > not in ( > goole(# select substring(w_vin from '(.{11}$)') from walon); NOT IN with a sub-select that returns any NULL valu

[SQL] select ..... not in .....

2007-05-14 Thread Gary Stainburn
I folks. I'm struggling with a select which should be easy. select v_d_code, v_o_number, v_vin, v_status from vista_details where v_d_code='64340' and v_o_number='C0023'; v_d_code | v_o_number |v_vin| v_status --++-+- 64340| C0023

Re: [SQL] need help

2007-05-14 Thread Ashish Karalkar
Anyone else is using this table simulteniously? With Regards Ashish... - Original Message - From: Penchalaiah P. To: pgsql-sql@postgresql.org Sent: Monday, May 14, 2007 12:20 PM Subject: [SQL] need help Hi . Create table cdano_nya(cdano int4,nyano int4) .

Re: [SQL] need help

2007-05-14 Thread Andrej Ricnik-Bay
On 5/14/07, Penchalaiah P. <[EMAIL PROTECTED]> wrote: Any one can help in this Operating system? Postgres version? How does psql behave? Anything in the logs? Cheers, Andrej ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner wi