🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: bit.databases.mssql-l
Article #2074

SQL Query

#2074
From: Chris Gadsby
Date: Wed, 05 Apr 1995 00:00
21 lines
826 bytes
re
John Murreys SQL Query

how about -


Select FIELDA = col1,
       FIELDB = (select sum(col3)
                 from table Y
                 where Y.col1 = X.col1
                 and Y.col2 = 1 ),
       FIELDB = (select sum(col3)
                 from table Z
                 where Z.col1 = X.col1
                 and Z.col2 = 2 )
from table X
group by col1


Chris Gadsby
cjg2@student.open.ac.uk
Technical Details
Message-ID: <memo.29569@cosy.open.ac.uk>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f6611,a9416d0271ddad6,start
X-Google-Attributes: gidf6611,public
From: Chris Gadsby <cjg2@STUDENT.OPEN.AC.UK>
Subject: SQL Query
Date: 1995/04/05
Message-ID: <memo.29569@cosy.open.ac.uk>
X-Deja-AN: 100977833
sender: Microsoft SQL Server Discussion List
comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
newsgroups: bit.databases.mssql-l