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 |
vadz82
Starting Member
1 Post |
Posted - 2011-10-07 : 11:01:25
|
Hi there! am novice to sql and i want to count and group my data like thisvalue1 val2 value3 value4delhi 43 india SAmadras 42 india SAlondon 55 england EUtoronto 68 canada NAtokyo 22 japan SEA kyoto 23 japan SEAontario 69 canada NAcalifornia 78 USA NAtexas 70 USA NAcarolina 72 USA MAmaryland 76 USA NAflorida 72 USA MAWales 55 england EUStakholom 50 sweden EUswitzerland 51 switzerland EUHeidelberg 53 germany EUinto this;value 4 value 3 val2EU england 2 germany 1 sweden 1 switzerland 1MA USA 2NA canada 2 USA 3 SA india 2SEA japan 2 For example i will use val2 as my reference.How am i going to do this? Thanks! |
|
Cindyaz
Yak Posting Veteran
73 Posts |
Posted - 2011-10-07 : 11:12:19
|
difficult to post a definitive reply. Please give your DDL statements (create table statements), along with sample data (preferably using insert statement) and expected output. That will help us to help you. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-10-07 : 12:29:55
|
looks more of a presentation issue. is it for reporting need? if yes, this format can be very easily generated in reporting tools using grouping levels.------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
paultech
Yak Posting Veteran
79 Posts |
Posted - 2011-10-07 : 14:15:53
|
Hello ,i tried to understand you ,But difficult so make more clarifications of your requirements, But i agree with visakh16 ,That if you want specific format to display your data ,So you need to use reporting tools as Crystal reportthanks |
|
|
|
|
|