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 |
|
micnie_2020
Posting Yak Master
232 Posts |
Posted - 2009-04-01 : 21:46:06
|
| Dear All,My TableName: TGPVListMembercode|RankID|PPV|TGPV|Downline1|Downline2|Downline3|Downline1GPV|Downline2GPV|Downline3GPVMYS00000000|100|307.5|1020306|MYS00000118|0|0|181812|MYS00000000|100|307.5|1020306|MYS00000001|607275.5|0|0MYS00000000|100|307.5|1020306|MYS00000115|0|230856|0MYS00000001|100|500|607275.5|MYS00000005|0|579469|0MYS00000001|100|500|607275.5|MYS00000002|8991.5 0|0Output that required:-Membercode|RankID|PPV|TGPV|Downline1|Downline2|Downline3|Downline1GPV|Downline2GPV|Downline3GPVMYS00000000|100|307.5|1020306|MYS00000001|MYS00000115|MYS00000118|607275.5|230856|181812MYS00000001|100|500|607275.5|MYS00000002|MYS00000005|8991.5|579469|0I have table structure- Tablename:TGPVList.I want to group the data for same membercode into a single line as mention above. Can anyone here help on the sql statement?Thank You & Appreciate for your help.Regards,Micheale |
|
|
micnie_2020
Posting Yak Master
232 Posts |
Posted - 2009-04-02 : 00:19:30
|
| Thank You.I got the answer from this forumn itself-Topic called Want an unique result replied by tkizer .The answer is used methodselect compid,max(department) as department,max(address) as address,max(city) as city,zipfrom @temp group by compid,zipThank you.God bless you.Regards,Michelle |
 |
|
|
|
|
|