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 |
|
nguyenl
Posting Yak Master
128 Posts |
Posted - 2009-05-22 : 14:35:47
|
| Hi,Please help.When I run this "select statement":Select PropertyNumber, Calculation.annual, Calculation.interestfrom PropertyNumber, Claculationwhere Property.id = Calculation.property_idAnd PropertyNumber = 1238944I get 2 results:1 result:PropertyNumber:1238944Calculation.annual: .2Calculation.interest: Null2 result:PropertyNumber: 1238944Calculation.annual: NuLLCalculation.interest: .12How do I write a select statment that combines the 2 results?For example:PropertyNumber: 1238944Calculation.annual: .2Calculation.interest: .12Thanks, |
|
|
mualsh
Starting Member
8 Posts |
Posted - 2009-05-22 : 15:56:40
|
| You may want to share your table definitions / structures (atleast the relevant columns) along with some sample data. |
 |
|
|
kira
Starting Member
17 Posts |
Posted - 2009-05-22 : 16:56:22
|
| [CODE]Select PropertyNumber, Calculation.annual, MAX(Calculation.interest)from PropertyNumber, Claculationwhere Property.id = Calculation.property_idAnd PropertyNumber = 1238944GROUP BY PropertyNumber, Calculation.annual[/CODE] |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-05-23 : 11:11:46
|
| [code]Select PropertyNumber, MAX(Calculation.annual), MAX(Calculation.interest)from PropertyNumber, Claculationwhere Property.id = Calculation.property_idAnd PropertyNumber = 1238944GROUP BY PropertyNumber[/code] |
 |
|
|
|
|
|