473,382 Members | 1,380 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

String aggregation with SQL

Hello!

I'm trying to find a way to aggregate string values from a column to
get a long strings separated by commas, based on specified criteria. I
found some solutions on the web though they don't really seem to work
with MS SQL.
Is there any way to do it using pure SQL in MS Access?

Thanks for all the answers!
Marek

Jul 23 '07 #1
3 5247
Baz
It's hard to say from such a vague description, but you're probably going to
need the Iif (immediate if) function.

"marekdec" <ma******@gmail.comwrote in message
news:11**********************@r34g2000hsd.googlegr oups.com...
Hello!

I'm trying to find a way to aggregate string values from a column to
get a long strings separated by commas, based on specified criteria. I
found some solutions on the web though they don't really seem to work
with MS SQL.
Is there any way to do it using pure SQL in MS Access?

Thanks for all the answers!
Marek

Jul 23 '07 #2
Thanks a lot, however it's not what I'm looking for.

I'm going to put it more clear (sorry about the lack of description).
So the thing is I my table contains a column of string values and a
column of numbers e.g.
"a" 1
"b" 1
"c" 2
"d" 2
One for row.
What I wanna do is to issue an operation that would result in
following:
"a,b" 1
"c,d" 2
In other words I want to concatenate all this letters that stand next
to 1 and all this that stand next to 2.
I'm aware this topic must have been discussed, though I can't find any
solution for Access sql.

I'm kinda newbie to databases that's why my description can be a bit
blurred.
Thanks for your help.
Marek


On 23 jul, 12:11, "Baz" <b...@REMOVEbcap.THEeuro1net.CAPScomwrote:
It's hard to say from such a vague description, but you're probably going to
need the Iif (immediate if) function.

"marekdec" <marek...@gmail.comwrote in message

news:11**********************@r34g2000hsd.googlegr oups.com...
Hello!
I'm trying to find a way to aggregate string values from a column to
get a long strings separated by commas, based on specified criteria. I
found some solutions on the web though they don't really seem to work
with MS SQL.
Is there any way to do it using pure SQL in MS Access?
Thanks for all the answers!
Marek- Ocultar texto de la cita -

- Mostrar texto de la cita -

Jul 23 '07 #3
Baz
That is indeed a tricky problem, and I can't immediately think of any way of
doing it in "pure" SQL. I think I would create a query which returned the
grouped numeric values, and which called a VBA function to return the column
containing the comma-delimited string.

Which would be neither elegant nor fast, I will be the first to admit!

"marekdec" <ma******@gmail.comwrote in message
news:11*********************@m3g2000hsh.googlegrou ps.com...
Thanks a lot, however it's not what I'm looking for.

I'm going to put it more clear (sorry about the lack of description).
So the thing is I my table contains a column of string values and a
column of numbers e.g.
"a" 1
"b" 1
"c" 2
"d" 2
One for row.
What I wanna do is to issue an operation that would result in
following:
"a,b" 1
"c,d" 2
In other words I want to concatenate all this letters that stand next
to 1 and all this that stand next to 2.
I'm aware this topic must have been discussed, though I can't find any
solution for Access sql.

I'm kinda newbie to databases that's why my description can be a bit
blurred.
Thanks for your help.
Marek


On 23 jul, 12:11, "Baz" <b...@REMOVEbcap.THEeuro1net.CAPScomwrote:
It's hard to say from such a vague description, but you're probably
going to
need the Iif (immediate if) function.

"marekdec" <marek...@gmail.comwrote in message

news:11**********************@r34g2000hsd.googlegr oups.com...
Hello!
I'm trying to find a way to aggregate string values from a column to
get a long strings separated by commas, based on specified criteria. I
found some solutions on the web though they don't really seem to work
with MS SQL.
Is there any way to do it using pure SQL in MS Access?
Thanks for all the answers!
Marek- Ocultar texto de la cita -
- Mostrar texto de la cita -


Jul 23 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Nice Chap | last post by:
Aggregation in COM was defined as 'Exposing an interface of an inner object by the outer object as though it were an interface of the outer object'. Is this type of aggregation possible in c#? ...
5
by: John Wood | last post by:
Let's say you're provided with an instance of a class. The instantiation takes place in another module that you have no control over. However, you've extended that class with your own value-added...
4
by: cmrchs | last post by:
Hi, how do I implement aggregation and how composition in C# ? When I say : an Airplane has a Pilot then I use aggregation but when I say : an Airplane has a Cockpit then I use composition. How...
2
by: Jozsef Bekes | last post by:
Hi, I would like to implement aggregation in C#, therefore I'd need to implement the queryinterface COM function of a class. I am not sure whether this can be done, and if yes where to start. If...
4
by: Frederik Vanderhaegen | last post by:
Hi, Can anyone explain me the difference between aggregation and composition? I know that they both are "whole-part" relationships and that composition parts are destroyed when the composition...
23
by: SenthilVel | last post by:
Hi Can any one let me know the websites/Pdf for learning Aggragation in C#?? Thanks Senthil
1
by: ninjutsu28 | last post by:
hi im juz a student so pls bear with my terminologies..juz wana ask how to perform aggregation in vb.net code.. in my model, i have rectangle, shape, drawing classes..rectangle class inherits...
5
by: isetea | last post by:
Hi, I'm working on a access database to automate our Staff procedures a bit. One part is to select several informations from a table and to aggregate some of the outputs. For example: 50 people...
0
by: Karigar | last post by:
I have been so far developing COM servers and clients in C++. I am new to C#/NET way of doing COM and was wondering if it is possible to accomplish aggregation in .NET platform. By aggregation I...
6
by: Jeff | last post by:
hey Can OO Aggregation be described as: - A system of objects that are built using each other any comments? Jeff
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.