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 |
|
piyushpardeshi4u
Starting Member
2 Posts |
Posted - 2012-03-27 : 09:50:53
|
| I have table say Producthaving data as follows with column name as ProductCode and ProductDetailsProductCode ProductDetails---------------------------Name marutiCode M001Qty 100Name suzukiCode N001Qty 1000Required output as:Name Code QtyMaruti M001 100Suzuki N001 1000 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-03-27 : 10:01:51
|
how do you relate the Code M001 belongs to maruti or suzuki ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
piyushpardeshi4u
Starting Member
2 Posts |
Posted - 2012-03-27 : 10:09:05
|
| M001 for maruti and M002 for susuki |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-03-27 : 10:21:07
|
yes. How do you determine that ? I don't see any relation of that in your tableBasically, what i am trying to say is, there is no way to know from you table that M001 is for maruti and M002 is for susuki KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-03-27 : 11:59:36
|
quote: Originally posted by piyushpardeshi4u M001 for maruti and M002 for susuki
do you've another field in table which indicates which Name,Code,Qty values should be grouped together?You cant rely upon order in which they're displayed as there's no concept of order in sql table unless you specify it explicitly by means of order by. So for that also you require a field------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|