473,440 Members | 1,654 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,440 software developers and data experts.

SQL Perform Relational Join To Delimited Field Data

Hi,

For some daft reason, the database I've been asked to look at stores a series of tickboxes from a website into a single field, with a delimiter separating them.

E.g.

RecordID | TickBoxCodes
------------ | -----------------
1 | TB1;TB4;TB6
2 | TB2;TB4
3 | <blank>
4 | TB1;TB3

Somehow I need to produce a GROUP BY query for this table that produces a summary of the data in the rest of the record grouped by the individual items in the delimited field.

E.g.

TickBoxCode | RecordCount
------------------ | -------------------
TB1 | 2
TB2 | 1
TB3 | 1
TB4 | 2
etc....

I have found various table UDFs that can take parameters in and delimit the result and output a table result. I figured great, I could pass in each row and join on the output to simulate the relational structure.

Unfortunately that only works using parameters for the input of the UDF, I cannot pass the function table/field names directly in the query.

E.g. this is what I thought I could do....

Expand|Select|Wrap|Line Numbers
  1. SELECT CodeTable.OutputID, CodeTable.ResultingSplitData, OT.RestOfFields
  2. INTO #sometemptable
  3. FROM dbo.OriginalTable OT,
  4. dbo.SplitToTable(OT.IdentifierColumn, OT.DelimitedDataColumn, ';') CodeTable
  5.  
Any ideas how this could be done in SQL?

Regards,
Rob.
Mar 15 '10 #1
1 1248
ck9663
2,878 Expert 2GB
How many records max(recordid) are we talking about here?

~~ CK
Mar 15 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Nige | last post by:
Is it possible to convert an item of form field data to uppercase using the toUpperCase() method? What I'm really asking is, how do I reference the data item? -- Nige Please replace YYYY...
2
by: Pavils Jurjans | last post by:
Hello, Is there some class among the thousands of .Net classes, that would do the tab-delimited text data parsing into, say, jagged array (an array of arrays). I have some code sources in other...
1
by: sleepyant | last post by:
Hi, how can I check the field data type of a column in a Dataset table? Like whether it is a DateTime, a Binary or Character. Please help. Thanks.
2
by: Yeah | last post by:
I have a simple fill-out form with three fields, in this order: Name, E-mail, and Comment. But when I receive the E-mail containing the form data, the fields are listed backwards (Comment, E-mail,...
2
by: comteck | last post by:
From one database, I am trying to create a table in a different database. Here is my code: Dim dbDeja As DAO.Database Dim tblEmployees As DAO.TableDef Dim fldEmployeeNumber As Field ...
0
by: comteck | last post by:
From one database, I am trying to create a table in a different database. Here is my code: Dim dbDeja As DAO.Database Dim tblEmployees As DAO.TableDef Dim fldEmployeeNumber As Field ' Open...
3
by: imtmub | last post by:
Hi All, I am facing some problem in the field data(Description field in Item table). In that table one field(Description field)data legth is 255 and type: nvarchar. In some operation this field data...
4
by: sufian | last post by:
Below is the field where user enters his/her email address and the AJAX post request is sent to the server and the user sees the message: echo("<div id=\"message\" class=\"success\">Thank you! You...
5
by: buster89 | last post by:
Hi! How to access the html-document's field-data from within a <script>-tag? I am trying to write a dynamic table (in a html-document) that is supposed to contain data that is stored in a...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.