From oracle-l-bounce@freelists.org Tue Jun 14 07:54:20 2005 Return-Path: Received: from air891.startdedicated.com (root@localhost) by orafaq.com (8.12.10/8.12.10) with ESMTP id j5ECsKFI021495 for ; Tue, 14 Jun 2005 07:54:20 -0500 X-ClientAddr: 206.53.239.180 Received: from turing.freelists.org (freelists-180.iquest.net [206.53.239.180]) by air891.startdedicated.com (8.12.10/8.12.10) with ESMTP id j5ECsKNi021491 for ; Tue, 14 Jun 2005 07:54:20 -0500 Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 45E421BBFB0; Tue, 14 Jun 2005 06:51:03 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 12793-08; Tue, 14 Jun 2005 06:51:03 -0500 (EST) Received: from turing (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id C54F61BD4DF; Tue, 14 Jun 2005 06:51:02 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit Subject: RE: COunt problem Date: Tue, 14 Jun 2005 07:49:10 -0400 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: COunt problem Thread-Index: AcVwiMkUhQveY0XWTRq7LAfLN7nWqwATdnaQ From: "Mercadante, Thomas F (LABOR)" To: , X-OriginalArrivalTime: 14 Jun 2005 11:49:10.0722 (UTC) FILETIME=[14166A20:01C570D7] X-archive-position: 21071 X-ecartis-version: Ecartis v1.0.0 Sender: oracle-l-bounce@freelists.org Errors-To: oracle-l-bounce@freelists.org X-original-sender: Thomas.Mercadante@labor.state.ny.us Precedence: normal Reply-To: Thomas.Mercadante@labor.state.ny.us X-list: oracle-l X-Virus-Scanned: by amavisd-new-20030616-p9 (Debian) at avenirtech.net X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on air891.startdedicated.com X-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=2.63 Kean, You can do it this way: Select emp_count, emp_dis_count >From ( select count(a.idcode) emp_count from emp ), ( select count(b.idcode) emp_dis_count from emp_dis b ) Your method is performing a Cartesian join involving both tables. The result would be bad. Tom -----Original Message----- From: oracle-l-bounce@freelists.org [mailto:oracle-l-bounce@freelists.org] On Behalf Of Kean Jacinta Sent: Monday, June 13, 2005 10:29 PM To: oracle-l@freelists.org Subject: COunt problem Hi , I am trying to do a count on 2 table at the same time. select count(a.idcode), count(b.idcode) from emp a, emp_dis b The result return are not corrent. Both idcode datatype is number. Actual table count for emp : 15 Actual table count for emp_dis :25 Thank You JK =09 __________________________________=20 Yahoo! Mail=20 Stay connected, organized, and protected. Take the tour:=20 http://tour.mail.yahoo.com/mailtour.html=20 -- http://www.freelists.org/webpage/oracle-l -- http://www.freelists.org/webpage/oracle-l