From magosoft@gmx.net Thu Jul 17 22:03:54 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.225.181]) by svr1.postgresql.org (Postfix) with ESMTP id B68B0CC456 for ; Thu, 17 Jul 2003 22:03:54 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr5.postgresql.org [64.117.225.181]) (amavisd-new, port 10024) with ESMTP id 37488-06 for ; Thu, 17 Jul 2003 22:04:09 +0000 (GMT) Received: from mail.gmx.net (mail.gmx.de [213.165.64.20]) by svr1.postgresql.org (Postfix) with SMTP id 6A20ECCB33 for ; Thu, 17 Jul 2003 19:03:40 -0300 (ADT) Received: (qmail 20496 invoked by uid 65534); 17 Jul 2003 22:04:10 -0000 Received: from unknown (EHLO guaj215desa) (168.234.69.22) by mail.gmx.net (mp002) with SMTP; 18 Jul 2003 00:04:10 +0200 MIME-Version: 1.0 Message-Id: <3F171D21.000005.03704@guaj215desa> Date: Thu, 17 Jul 2003 16:03:13 -0600 Content-Type: Multipart/related; type="multipart/alternative"; boundary="------------Boundary-00=_DXV66RO0000000000000" X-Mailer: IncrediMail 2001 (1850912) From: "Marvin" X-FID: FLAVOR00-NONE-0000-0000-000000000000 X-FVER: 3.0 X-CNT: ; X-Priority: 3 To: Subject: Sub-Select problem Reply-To: "Marvin" X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=1.2 tagged_above=0.0 required=5.0 tests=ASCII_FORM_ENTRY, BAYES_30, EXTRA_MPART_TYPE, HTML_50_60, HTML_FONT_FACE_ODD, HTML_TAG_EXISTS_TBODY, RCVD_IN_ORBS X-Spam-Level: * X-Archive-Number: 200307/156 X-Sequence-Number: 9496 --------------Boundary-00=_DXV66RO0000000000000 Content-Type: Multipart/Alternative; boundary="------------Boundary-00=_DXV612S0000000000000" --------------Boundary-00=_DXV612S0000000000000 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I was trying to do something like this.=0D =0D Select Field1, Field2, Total=0D FROM =0D (Select Field1, Field2, SUM(Field3) as Total=0D From TableA=0D Where DateHired <=3D CAST('08/01/2003' AS DATE)=0D GROUP BY Field1) as MyTable;=0D =0D The sub-select query tested alone returns me a lot of rows,=0D however when I make all the query it returns me nothing.=0D =0D Please help!!!=0D I'm in rush.=0D =0D Thank you in advanced for ANY suggestion,=0D =0D =0D MAGO --------------Boundary-00=_DXV612S0000000000000 Content-Type: Text/HTML; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I was trying to do something like this.
 
Select Field1, Field2, Total
FROM
    (Select Field1, Field2, SUM(Field3) as Total
    From TableA
    Where DateHired <=3D CAST('08/01/2003' AS DATE)<= /DIV>
    GROUP BY Field1) as MyTable;
 
The sub-select query tested alone returns me a lot of rows,<= /DIV>
however when I make all the query it returns me nothing.
 
Please help!!!
I'm in rush.
 
Thank you in advanced for ANY suggestion,
 
 
MAGO
____________________________= _____________________________________
3D""  IncrediMail - El E-m= ail ha evolucionado finalmente - Haga clic aqu=ED
--------------Boundary-00=_DXV612S0000000000000-- --------------Boundary-00=_DXV66RO0000000000000 Content-Type: image/gif; name="IMSTP.gif" Content-Transfer-Encoding: base64 Content-ID: <38E777D6-F220-4E3B-BD6C-D1C8D49626AD> R0lGODlhFAAPALMIAP9gAM9gAM8vAM9gL/+QL5AvAGAvAP9gL////wAAAAAA AAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJFAAIACwA AAAAFAAPAAAEVRDJSaudJuudrxlEKI6BURlCUYyjKpgYAKSgOBSCDEuGDKgr AtC3Q/R+hkPJEDgYCjpKr5A8WK9OaPFZwHoPqm3366VKyeRtE30tVVRscMHD qV/u+AgAIfkEBWQACAAsAAAAABQADwAABBIQyUmrvTjrzbv/YCiOZGmeaAQA IfkECRQACAAsAgABABAADQAABEoQIUOrpXIOwrsPxiQUheeRAgUA49YNhbCq K1kS9grQhXGAhsDBUJgZAL2Dcqkk7ogFpvRAokSn0p4PO6UIuUsQggSmFjKX dAgRAQAh+QQFCgAIACwAAAAAFAAPAAAEEhDJSau9OOvNu/9gKI5kaZ5oBAAh +QQJFAAIACwCAAEAEAANAAAEShAhQ6ulcg7Cuw/GJBSF55ECBQDj1g2FsKor WRL2CtCFcYCGwMFQmBkAvYNyqSTuiAWm9ECiRKfSng87pQi5SxCCBKYWMpd0 CBEBACH5BAVkAAgALAAAAAAUAA8AAAQSEMlJq7046827/2AojmRpnmgEADs= --------------Boundary-00=_DXV66RO0000000000000-- From magosoft@gmx.net Thu Jul 17 22:27:17 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.192]) by svr1.postgresql.org (Postfix) with ESMTP id 1C689CCA98 for ; Thu, 17 Jul 2003 22:27:17 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr4.postgresql.org [64.117.224.192]) (amavisd-new, port 10024) with ESMTP id 63806-07 for ; Thu, 17 Jul 2003 22:27:39 +0000 (GMT) Received: from mail.gmx.net (mail.gmx.de [213.165.64.20]) by svr1.postgresql.org (Postfix) with SMTP id DD9E4CC456 for ; Thu, 17 Jul 2003 19:27:10 -0300 (ADT) Received: (qmail 30208 invoked by uid 65534); 17 Jul 2003 22:27:40 -0000 Received: from unknown (EHLO guaj215desa) (168.234.69.22) by mail.gmx.net (mp025) with SMTP; 18 Jul 2003 00:27:40 +0200 MIME-Version: 1.0 Message-Id: <3F1722A4.000003.03704@guaj215desa> Date: Thu, 17 Jul 2003 16:26:44 -0600 Content-Type: Multipart/related; type="multipart/alternative"; boundary="------------Boundary-00=_K0X6G6G0000000000000" X-Mailer: IncrediMail 2001 (1850912) From: "Marvin" References: <008001c34cb1$b40bcb20$0b00a8c0@controllab.com.br> X-FID: FLAVOR00-NONE-0000-0000-000000000000 X-FVER: X-CNT: ; X-Priority: 3 To: Cc: Subject: Re: Sub-Select problem Reply-To: "Marvin" X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/157 X-Sequence-Number: 9497 --------------Boundary-00=_K0X6G6G0000000000000 Content-Type: Multipart/Alternative; boundary="------------Boundary-00=_K0X6BHK0000000000000" --------------Boundary-00=_K0X6BHK0000000000000 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I executed the same query on a command line console and it worked=0D I think the problem is that I'm using EMS PostgreSQL Manager and=0D it does not return me anything from the SQL Editor.=0D =0D Thank you for the help.=0D =0D MAGO=0D =0D -------Mensaje original-------=0D =0D De: Rafael de Almeida Balthazar=0D Fecha: Jueves, 17 de Julio de 2003 04:23:23 p.m.=0D A: Marvin=0D Asunto: Re: [ADMIN] Sub-Select problem=0D =0D I executed this same query and all the rows have been showed. The only=0D problem was I had to include field2 in the group by statement.=0D I am running postgresql 7.2.3-5.80 over Red Hat 8.=0D =0D ----- Original Message ----- =0D From: Marvin=0D To: pgsql-admin@postgresql.org=0D Sent: Thursday, July 17, 2003 7:03 PM=0D Subject: [ADMIN] Sub-Select problem=0D =0D =0D I was trying to do something like this.=0D =0D Select Field1, Field2, Total=0D FROM=0D (Select Field1, Field2, SUM(Field3) as Total=0D =46rom TableA=0D Where DateHired <=3D CAST('08/01/2003' AS DATE)=0D GROUP BY Field1) as MyTable;=0D =0D The sub-select query tested alone returns me a lot of rows,=0D however when I make all the query it returns me nothing.=0D =0D Please help!!!=0D I'm in rush.=0D =0D Thank you in advanced for ANY suggestion,=0D =0D =0D MAGO=0D =0D =0D _________________________________________________________________=0D IncrediMail - El E-mail ha evolucionado finalmente - Haga clic aqu=ED=0D =0D .=20 --------------Boundary-00=_K0X6BHK0000000000000 Content-Type: Text/HTML; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I executed the same query on a command line console and it worked
I think the problem is that I'm using EMS PostgreSQL Manager and<= /DIV>
it does not return me anything from the SQL Editor.
 
Thank you for the help.
 
MAGO
 
-------Mensaje original-------
 
Fecha: Jueves, 17 de= Julio de 2003 04:23:23 p.m.
Asunto: Re: [ADMIN] = Sub-Select problem
 
I executed this same query and all the rows have been show= ed. The only
problem was I had to include field2 in the group by stateme= nt.
I am running postgresql 7.2.3-5.80 over Red Hat 8.

----- Orig= inal Message -----
From: Marvin
To: pgsql-admin@postgresql.org
Sent: Thursday, July 17, 20= 03 7:03 PM
Subject: [ADMIN] Sub-Select problem


I was trying t= o do something like this.

Select Field1, Field2, Total
FROM
(S= elect Field1, Field2, SUM(Field3) as Total
From TableA
Where DateHire= d <=3D CAST('08/01/2003' AS DATE)
GROUP BY Field1) as MyTable;
The sub-select query tested alone returns me a lot of rows,
however whe= n I make all the query it returns me nothing.

Please help!!!
I'm = in rush.

Thank you in advanced for ANY suggestion,


MAGO

_________________________________________________________________=
IncrediMail - El E-mail ha evolucionado finalmente - Haga clic aqu=ED
.
____________________________= _____________________________________
3D""  IncrediMail - El E-m= ail ha evolucionado finalmente - Haga clic aqu=ED
--------------Boundary-00=_K0X6BHK0000000000000-- --------------Boundary-00=_K0X6G6G0000000000000 Content-Type: image/gif; name="IMSTP.gif" Content-Transfer-Encoding: base64 Content-ID: <2CDCA82C-7391-44C8-BFF8-0A82A16EC631> R0lGODlhFAAPALMIAP9gAM9gAM8vAM9gL/+QL5AvAGAvAP9gL////wAAAAAA AAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJFAAIACwA AAAAFAAPAAAEVRDJSaudJuudrxlEKI6BURlCUYyjKpgYAKSgOBSCDEuGDKgr AtC3Q/R+hkPJEDgYCjpKr5A8WK9OaPFZwHoPqm3366VKyeRtE30tVVRscMHD qV/u+AgAIfkEBWQACAAsAAAAABQADwAABBIQyUmrvTjrzbv/YCiOZGmeaAQA IfkECRQACAAsAgABABAADQAABEoQIUOrpXIOwrsPxiQUheeRAgUA49YNhbCq K1kS9grQhXGAhsDBUJgZAL2Dcqkk7ogFpvRAokSn0p4PO6UIuUsQggSmFjKX dAgRAQAh+QQFCgAIACwAAAAAFAAPAAAEEhDJSau9OOvNu/9gKI5kaZ5oBAAh +QQJFAAIACwCAAEAEAANAAAEShAhQ6ulcg7Cuw/GJBSF55ECBQDj1g2FsKor WRL2CtCFcYCGwMFQmBkAvYNyqSTuiAWm9ECiRKfSng87pQi5SxCCBKYWMpd0 CBEBACH5BAVkAAgALAAAAAAUAA8AAAQSEMlJq7046827/2AojmRpnmgEADs= --------------Boundary-00=_K0X6G6G0000000000000--