RE: SQL Problem - Merging Result sets

2003-03-26 Thread Jeroen van Sluisdam
Hi, Try something like select id, numberrowsA, numberrowsB .. from master_tab m, (select id, count(*) numberrowsa from detail_tabA a where m.id = a.id group by a.id) da, (select id, count(*) numberrowsb from detail_tabb b where m.id = b.id group by b.id) db, ... where da.id = m.id and

RE: SQL Problem - Merging Result sets

2003-03-26 Thread DENNIS WILLIAMS
Tony - 8i does have outer joins, the syntax is (+) - intuitive right? I haven't run this query, but it might give some ideas. Since nobody has responded yet, maybe it'll provoke the experts ;-) select r1.id, r2.count(*), r3.count(*), r4.count(*) from (select id from master_tab) r1,

RE: SQL Problem - Merging Result sets

2003-03-26 Thread Mercadante, Thomas F
Tony, this works also: select distinct r1.id, count(r2.id),count(r3.id),count(r4.id) from r1, r2, r3, r4 where r2.id (+) = r1.id and r3.id (+) = r1.id and r4.id (+) = r1.id group by r1.id Tom Mercadante Oracle Certified Professional -Original Message- Sent: Wednesday, March 26,

Re: Sql problem

2002-12-20 Thread Zsolt Csillag
Tim, Thank you very much for your help. I think it'll work. Zsolt At 07:04 2002.12.19. -0800, you wrote: Zsolt, In Oracle9i, you might be able to make use of the new WITH syntax: SQL with xxx as 2 (select 1+2 calc from dual) 3 select calc*2 from xxx;

RE: Sql problem

2002-12-19 Thread Stephane Faroult
Two possible answers : 42 and inline views. - Original Message - From: Zsolt Csillag [EMAIL PROTECTED] To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] Sent: Thu, 19 Dec 2002 05:43:55 Hi, The following select does not work, I get ORA-00904 error message that the AgentShare

RE: Sql problem

2002-12-19 Thread Khedr, Waleed
Use inline views, create a view or use a cursor in a PL/sql block Regards, Waleed -Original Message- Sent: Thursday, December 19, 2002 8:44 AM To: Multiple recipients of list ORACLE-L Hi, The following select does not work, I get ORA-00904 error message that the AgentShare column

Re: Sql problem

2002-12-19 Thread Tim Gorman
Zsolt, In Oracle9i, you might be able to make use of the new WITH syntax: SQL with xxx as 2 (select 1+2 calc from dual) 3 select calc*2 from xxx; CALC*2 -- 6 It might cut down on typographic errors (if not syntax complexity)

Re: SQL problem: retrieve child records if existent

2001-05-31 Thread Stephane Faroult
Helmut Daiminger wrote: Hi! I have a SQL problem here, which I can't solve. I have a B-tree structure in a table (parentID, childID). If a parent has kids then select those kids. If not, select this parent. How do I code this in SQL? I tried using connect by but this doesn't

RE: SQL PROBLEM

2001-05-25 Thread Niyi Olajide
Title: MS access Can you try this: select count (1) from ( select1 from table_ a where ord_id =17 union select 1 from table_b where ord_id = 17) / Hi, Favour me insuggest ahint in writing a sql forfollowing scenaio: Table A has 2 columns ord_id and line_id example rows are:

RE: SQL PROBLEM

2001-05-25 Thread Mohan, Karthik (GEP)
Message-From: Niyi Olajide [mailto:[EMAIL PROTECTED]]Sent: Friday, May 25, 2001 4:36 PMTo: Multiple recipients of list ORACLE-LSubject: RE: SQL PROBLEM Can you try this: select count (1) from ( select1 from table_ a where ord_id =17 union select 1 from table_b

Re: SQL PROBLEM for duplicate rows..

2001-05-25 Thread Burçin Üstün Kýlýç
I think this query eliminates the duplicated rows: delete from table_name where rowid not in (select maxrowid from (select column1,column2, max(rowid) maxrowid from den group by column1,column2)); - Original Message - To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] Sent:

Re: SQL PROBLEM for duplicate rows..

2001-05-25 Thread Burçin Üstün Kýlýç
I am sorry I made a mistake in naming . Correct one is below: delete from table_name where rowid not in (select maxrowid from (select column1,column2, max(rowid) maxrowid from table_name group by column1,column2)); - Original Message - To: Multiple recipients of list ORACLE-L [EMAIL

Re: SQL PROBLEM for duplicate rows..

2001-05-25 Thread N. SARAVANA KUMAR
Yes, It works .. Thanks.. On Fri, 25 May 2001, [iso-8859-1] Burçin Üstün Kýlýç wrote: I think this query eliminates the duplicated rows: delete from table_name where rowid not in (select maxrowid from (select column1,column2, max(rowid) maxrowid from den group by column1,column2));