Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
sqldbaa
Starting Member
32 Posts |
Posted - 2008-02-29 : 06:34:27
|
Hi ,I have the below tablesTable 1 with columnsid intprice charquantity intdate dateIn this table, same id has several entries at different date.table 2 with columnsgroupid intgroupname chartable 3 with columnsid intgroupid intI want the result asid groupnamesum(quantity * price) for each id Please help me in writing a query for this Thanks in advance |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-02-29 : 07:17:32
|
sum(quantity * cast(price as money)) E 12°55'05.25"N 56°04'39.16" |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2008-02-29 : 07:17:43
|
Why is price a CHAR??? Always use the correct datatypes for your data, that is the #1 simplest, most important rule of database programming.- Jeffhttp://weblogs.sqlteam.com/JeffS |
|
|
|
|
|