|
Home > Archive > MS SQL Server MSEQ > August 2005 > Query needs to loop?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Query needs to loop?
|
|
| DonSQL2222 2005-08-25, 8:24 pm |
| Is this possible?
A char variable length field contains this data: (for example)
ABC,XYZ,GEF,CAB
I need to query another table on the contents of each of these names that
are separated by comma.
I need to read ABC and then query another table for ABC in field1 and pick
up some fields.
Then, I need to do the same for XYZ, etc, reading across.
How can I parse the field that's comma delim, and in one continuous select
statment pick all the data from another table? Put a looping statement into
the Select statement to read through the comma delim field until done?
Thanks,
Don
| |
| Hugo Kornelis 2005-08-25, 8:24 pm |
| On Thu, 25 Aug 2005 14:55:34 -0700, DonSQL2222 wrote:
>Is this possible?
>A char variable length field contains this data: (for example)
>ABC,XYZ,GEF,CAB
>I need to query another table on the contents of each of these names that
>are separated by comma.
>I need to read ABC and then query another table for ABC in field1 and pick
>up some fields.
>Then, I need to do the same for XYZ, etc, reading across.
>How can I parse the field that's comma delim, and in one continuous select
>statment pick all the data from another table? Put a looping statement into
>the Select statement to read through the comma delim field until done?
>Thanks,
>Don
Hi Don,
http://www.sommarskog.se/arrays-in-sql.html
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)
|
|
|
|
|