| Author |
Topic |
|
mdProgrammer
Starting Member
3 Posts |
Posted - 2005-11-04 : 16:36:59
|
I'm not quite sure how to tackle this (a few attempts didn't work), but let's say I have a table that lists 2 columns (for example, city and name). Now, the city field does repeat, and will have several different names. Here's an example:Atlanta JoeAtlanta SueAtlanta FredBaltimore JimBaltimore KellyBaltimore AmyCincinatti PeteCincinatti BillCincinatti Sarah What I want it to do is to put all names from 1 city into 1 variable (so that I can put it into a larger query). So, it might be something like this:City NameAtlanta Joe Sue FredBaltimore Jim Kelly AmyCincinatti Pete Bill Sarah The final result would look something like this:Table with 2 records:SomeField1 SomeField2 SomeField3 NamesXYZ XYZ XYZ Pete Bill Sarah------------------------------------------------------XYZ XYZ XYZ Jim Kelly Amy------------------------------------------------------ So, how would I do this? |
|
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2005-11-04 : 17:07:53
|
| If you are talking about suppressing duplicate data on consecutive rows, this is a common feature of reporting software such as Crystal or MS Access. It is a formatting issue, and should be handled by your presentation layer. QUERY ANALYZER IS NOT A USER INTERFACE!Can this be done using SQL code? Yes. But it is purely an exercise in MaSQLbation, so don't do it. |
 |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2005-11-04 : 17:17:04
|
>>But it is purely an exercise in MaSQLbation, so don't do it.Wait a minute, your name is BlindMan? You mean what my mother told me is true?!? Be One with the OptimizerTG |
 |
|
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2005-11-04 : 19:10:35
|
Not sure what your mother told you, but most of what my mother told me turned out to be true... |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-11-05 : 00:28:45
|
| Where do you want to show these data?If you are using Reports, then use its "Suppress If Duplicated" featureMadhivananFailing to plan is Planning to fail |
 |
|
|
t1g312
Posting Yak Master
148 Posts |
Posted - 2005-11-05 : 03:25:45
|
quote: Originally posted by TG >>But it is purely an exercise in MaSQLbation, so don't do it.Wait a minute, your name is BlindMan? You mean what my mother told me is true?!? Be One with the OptimizerTG
Blindman, do you have pimples on your face as well? :PAdi |
 |
|
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2005-11-05 : 22:05:12
|
| I'm much too old for that. But it sure is a pain shaving my palms every week. |
 |
|
|
mdProgrammer
Starting Member
3 Posts |
Posted - 2005-11-07 : 09:16:58
|
| Umm, guys? I'm trying get help here, not read spam.I have a dyanmic datagrid in ASP.NET that uses a query to get some data, but... in one new column, I want it to list some data based on a value in that row. (similar to a nested datagrid I guess). The data I want is shown in several rows. What I want to do is to combine them onto a single line - (like "data1, data2, data3"). |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
mdProgrammer
Starting Member
3 Posts |
Posted - 2005-11-07 : 09:54:59
|
| That's exactly what I was looking for. Thanks.I had some code close to it, but just couldn't figure out the correct way of going about it. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|