Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8449471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:43:01+00:00 2026-06-10T10:43:01+00:00

I have a field in a data feed coming in with some values separated

  • 0

I have a field in a data feed coming in with some values separated by commas. For one record, the values are:

A06,C05,C06,C15,C18,C19,C21,C22,E05,E22,G11,J02,J07,L04,L07,M01,M05,N03,N07,N10,N11,N12,N18,N19,N20,N24,O02,O03,O04,O06,O09,O14,O15,O16,O20,O21,O31,Q01,Q04,Q08,R07,S08,T08,T12,T23,T32,U01,U03,U04,U06,U13,W09,W11,W16,W19,W30,W45,X02,X03,X12,Z07

I have a separate table with some descriptions as to what each code means. When I query the main table and get this field name as a value, I can use explode to get it into an array and use a foreach loop to output each value.

The problem is, I want to display the description stored in another table. What’s the proper way of iterating through this to display these values in a list?

As an example, C21 means “Gated Community.”

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T10:43:03+00:00Added an answer on June 10, 2026 at 10:43 am

    You can use FIND_IN_SET() function for that.

    Example you have record like this

    Orders Table
    ------------------------------------
    OrderID     |     attachedCompanyIDs
    ------------------------------------
       1                     1,2,3               -- comma separated values
       2                     2,4     
    

    and

    Company Table
    --------------------------------------
    CompanyID      |        name
    --------------------------------------
        1                 Company 1
        2                 Another Company
        3                 StackOverflow
        4                 Nothing
    

    Using the function

    SELECT name 
    FROM orders, company
    WHERE orderID = 1 AND FIND_IN_SET(companyID, attachedCompanyIDs)
    

    will result

    name
    ---------------
    Company 1
    Another Company
    StackOverflow
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a report that is returning a one data field to a tablix
I have a Data class with one field, price. I referenced the price field
I have a data field that contains large numbers in two formats: 553000.468...705.46.0000000 <-
I have a file (dictionary.txt) with data field entries as follows - ABC This
I have a combobox that is filled with data field JobCode from database. There
I have a field format: {2G Network:GSM 850,3G Network:HSDPA 850} How to put data
I have a field type varchar in sql server. It contains data like 010109
I'm going to be importing the data and I have a field that will
I have recently become interested in the field(s) of data mining and machine learning.
I have a mysql table field set as time type which stores data in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.