Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: SQL statement


Message #1 by "Bhamini Saboo" <bhamini@a...> on Sat, 14 Dec 2002 10:49:37 +0530 (India Standard Time)
it does run, but what if i require the sum of 2 fields from the same table

do i need to have separate select statements for each or what ?

bharat
 
-------Original Message-------
 
From: professional vb
Date: Sunday, December 15, 2002 02:07:06
To: professional vb
Subject: [pro_vb] RE: SQL statement
 
I can't test it, but I think this should work...

SELECT FT.tranId,
FT.srNo,
FT.inQty,
(SELECT SUM(ST.dlbQty)
FROM ST
WHERE ST.tranid = FT.tranId)
FROM FT
ORDER BY 1

Pete

-----Original Message-----
From: Bhamini Saboo [mailto:bhamini@a...]
Sent: Saturday, December 14, 2002 12:20 AM
To: professional vb
Subject: [pro_vb] SQL statement
Importance: High


Hi all my scenario for the sql query is thus : First Table
(FT) -------------- tranId srNo inQty dlvQty Second Table
(ST) --------------------------- FT.tranid FT.srNo dlvQty The second table
can contain multiple instances of delivery for a particular
FT.tranID Can anyone code the query for the following result : FT.tranId
FT.srNo FT.inQty sum(ST.dlvQty) Please respond immediately as I am stuck
with it. Regards Bharat Saboo




. 

  Return to Index