extraction of data in a comma-deliniated in a Mysql database list

I have a database table called meetings. In the table of meetings, it has columns named 'meeid', 'meedate' and 'meememberIDs '. using ColdFusion 9, I am able to present a date Standard in the "meedate" and a comma-delimited list in memberID that was present from a series of checkboxes in a form. It looks like this:

meeid = 2

"meedate = '" 2014-06-15

meememberIDs = '3,5,67,78,354, 2345'

Now that I have a record of the date and a is list of comma-delineate of membersID who came to a meeting, possible using SQL support to extract the Member ID and numbers match the primary key of another table called 'personal' in which each column meememberIDs comma-delimited number would return the name and the email to the Member of the staff?

example:

3 = michael jones- [email protected]

5 = ebinger chris- [email protected]

67 = alfred Fox- [email protected]

College Kid,

Storage of lists separated by commas in a single database column is generally considered to be "a bad idea".  Why? Mainly, for the simple reason you're struggling with - these data to other tables.  A junction table or a relationship is the best way to store multiple values.  Here's how this might work (there might be some subtle problems with the structure/query of the table syntax below that I have no experience with MySQL, only Microsoft SQL Server):

Table of assemblies:

meeid (integer)

meedate (date or time)

Table of personnel:

personnelID (or whatever it is called in your table) (integer)

FullName (varchar())

email (varchar())

... the rest columns in existing table

Table MeetingsPersonnel:

meeid (integer)

personnelID (integer)

Instead of storing a list separated by commas on identifying personal in the meetings table meememberIDs column, you would insert a record in the MeetingsPersonnel table for each combination of staff and the meeting.  Thus in the example above, the three topics that you have demonstrated would be stored in the MeetingsPersonnel table like this:

meeid personnelID

2         3

2         5

2 67

Now if you want to generate a list of people who attend meetings, join meetings to staff through the MeetingsPersonnel table:

SELECT p.fullname,
       p.email
FROM meetings m
     INNER JOIN meetingspersonnel mp on m.meeid = mp.meeid
     INNER JOIN personnel p on mp.personnelID = p.personnelID
WHERE m.meedate = '2014-06-15'

If you create indexes on these tables, this arrangement will happen very, very quickly.

The alternative is to write your own function to parse the list separated by commas into a temporary table and then use the temporary table to be the intermediate join.  It will be very inefficient, especially as the number of employees who attend a specific meeting increases.

-Carl V.

Tags: ColdFusion

Similar Questions

  • Firefox Version 27 Action Menu error in Reporting Services. An error has occurred with the extraction of data.

    Hello, since I've updated for Firefox 27.0.1 on Windows 7, I have a problem with Reporting Services on a Sharepoint site. It is a site of Sharepoint 2010 with SQL Server Reporting Services 2012 Sharepoint integrated mode. I was already on Firefox version 26 and didn't meet with this problem.

    When a report is opened and you use the Actions link on the Reporting Services toolbar, I get the following error messages.

    An error has occurred with the extraction of data. Please, refresh the page and try again.

    I tried updating to the beta version of Firefox 28 but the same error occurs. I see that someone else is having the same problem here. http://SharePoint-community.NET/forum/topics/reporting-service-and-Firefox-27

    Any help would be appreciated. Thank you!

    Ryan

    Firefox version 28.0 has corrected this problem. Thank you!

  • DV7 - 7333cl: how to extract usable data from a bad drive using 22 pins adapter usb to SATA on the new HD

    Greetings HP Forum,

    Recently, I replaced a bad hard drive on my laptop. I need now step by step procedure to extract usable data from the wrong drive using 22 pins adapter usb to SATA on the new HD.

    NOTE: I can't not all data that especially if some of the software downloaded on the replaced disk can be altered. Should I first download Internet Antivirus to protect my new hard drive? I'm not an expert, or even close to this when you work on the back of the laptop, so I'll have to step by step how to download and to partition the data recoverable and software, etc..

    Thanks in advance for your help... I greatly appreciate it!

    See you soon!

    Wes

    It is not complex. Attach the drive to the adapter and connect it to any other computer with good antivirus and antispyware installed. I use Malwarebytes and Avast. When you connect the adapter with the drive connected to the usb port, the drive will appear and it will be assigned a letter maybe E:\ or F:\ or something else. Immediately, he analyzes with the antivirus and anti-spyware. Quarantine or delete any virus or malware it finds. Then, it's just a matter of navigate the disk and copy and paste the contents of the host computer in a directory for this purpose. Obviously, you can copy from documents word, photos, music files, but you cannot copy the applications like Microsoft Word, iTunes. Photoshop.  You may need to take ownership of the files on the old hard drive, but Windows will guide you through this. Don't know what else I can answer.

  • extract table data to different locations

    Hello

    I collected data in the format:

    Temp: 25 Freq: 136 100 99.993 2998,581 0
    Temp: 25 Freq: 136 125,89 125.991 2997,196-0.004
    Temp: 25 Freq: 136 158,48 158.007 - 2995, 1 0.01
    Temp: 25 Freq: 136 199,52 200.002 2991, 905 - 0.019
    Temp: 25 Freq: 155 100 100.005 3000,866 0.003
    Temp: 25 Freq: 155 125,89 126.003 3000,086 0.000
    Temp: 25 Freq: 155 158,48 157.985 2996, 133 - 0.011
    Temp: 25 Freq: 155 199,52 200.018 2992,644-0,021
    Temp: 25 Freq: 174 100 100 3001,405 0.000
    Temp: 25 Freq: 174 125,89 126.016 2997, 996 - 0.010
    Temp: 25 Freq: 174 158,48 158.013 2996,371-0.015
    Temp: 25 Freq: 174 199,52 199.983 2992, 315 - 0,026
    Temp :-30 Freq: 136 100 99.993 2998,581 0
    Temp :-30 Freq: 136 125,89 125.991 2997,196-0.004
    Temp :-30 Freq: 136 158,48 158.007 - 2995, 1 0.01
    Temp :-30 Freq: 136 199,52 200.002 2991, 905 - 0.019
    Temp :-30 Freq: 155 100 100.005 3000,866 0.003
    Temp :-30 Freq: 155 125,89 126.003 3000,086 0.000
    Temp :-30 Freq: 155 158,48 157.985 2996, 133 - 0.011
    Temp :-30 Freq: 155 199,52 200.018 2992,644-0,021
    Temp :-30 Freq: 174 100 100 3001,405 0.000
    Temp :-30 Freq: 174 125,89 126.016 2997, 996 - 0.010
    Temp :-30 Freq: 174 158,48 158.013 2996,371-0.015
    Temp :-30 Freq: 174 199,52 199.983 2992, 315 - 0,026
    Temp: + 70 Freq: 136 100 99.993 2998,581 0
    Temp: + 70 Freq: 136 125,89 125.991 2997,196-0.004
    Temp: + 70 Freq: 136 158,48 158.007 - 2995, 1 0.01
    Temp: + 70 Freq: 136 199,52 200.002 2991, 905 - 0.019
    Temp: + 70 Freq: 155 100 100.005 3000,866 0.003
    Temp: + 70 Freq: 155 125,89 126.003 3000,086 0.000
    Temp: + 70 Freq: 155 158,48 157.985 2996, 133 - 0.011
    Temp: + 70 Freq: 155 199,52 200.018 2992,644-0,021
    Temp: + 70 Freq: 174 100 100 3001,405 0.000
    Temp: + 70 Freq: 174 125,89 126.016 2997, 996 - 0.010
    Temp: + 70 Freq: 174 158,48 158.013 2996,371-0.015
    Temp: + 70 Freq: 174 199,52 199.983 2992, 315 - 0,026

    I am able to extract specific data and establish a curve for the different Freqs (see "extract file_for email.VI pivot table).  I would like to help in order now to a parcel with a fixed frequency but different time (therefore field will be 3 Graphics: 25-30, + 70 for the same word of freq 136).

    Thanks for your help and your time,

    hiNi.

    This code gross works for any number of temperatures and allow for different sizes of each table (say that you measured 3 points to 1, temp and 6 points to another).  I strongly doubt this operation is necessary, but this is how the code works.

    Just drop the and connect the tables correctly loaded from your text file to place the controls in table I used.  (or you can wire up and use it as a subvi).

  • Extraction of data from MS SQL .bak file

    Hi all

    I received a MS SQL .bak file and need to extract the data into it, what should I do to achieve this?

    In addition, what is a bak file? It's a backup for a database file? I remember that I read somewhere that backup database has several different method (for example, the differential backup, the full backup), which will affect the restoration?

    Thank you

    Lee

    Hi Lee

    Your best resource for information is the Forum dedicated to suppoeting SQL.

    Category of the SQL Server:

    http://social.msdn.Microsoft.com/forums/en-us/category/SQLServer

    Concerning

  • DBTools extract element data

    Hello

    Calling a stored procedure from a MS - SQL database 2005, and he returned the 2 dozen fields.  I need to combine the result data in a cluster for my client.

    Its cluster contains booleans, strings and I32s and slna.

    I need to do the same thing, but my data comes from the function "dbtools extract the data of the item.  Problem is that I can't get output anywhere to convert native data types so that the function of the original function of the customer Cluster beam.

    Can someone point me to an example of LV function for this code?  I tried to use the "database of Variant data", but I have not found the magic way to make sure the function bundle sees a native data type.

    Help to LV and this forum are not telling me what I need to know.

    Any help is greatly appreciated!

    Dave

    OK maybe the 'database of Variant data"is most appropriate?

  • Extract ODBC data Long field names

    I need to extract some data created by the 4 lookout data logging (files .thd).  Is it possible to do so. I use a PC that does not have installed belvedere, I only database files

    What I got so far is to export some fields whose names are less than 62 characters (using the program Logos 4.5 and driver ODBC database of 4 of Citadel by strict limitation of the field at 62 names). If I increase the limit to about 100 required to extract all the fields I can't export to Microsoft Query or any other software (which supports the import of ODBC database). I've tried several programs but usually they jump a message you can read that one point in time (or they do not see the fields or values at all)

    Please, can you tell me a way I can extract the data?

    The lifecycle of database is not applied in an aggressive manner. The database do not try and remove data simply because life has expired. On the contrary, the life expectancy is applied only when new data are currently recorded in the database and the log would need to increase the size of the database to store incoming data. The rate at which data are removed from the database may vary according to the rate at which new data are recorded in the database. If the frequency of recording is slow, it may take a long time for the data to be deleted.

    J.D. Robertson

    National Instruments

  • extraction of data on broken laptop

    My laptop is saying there is Aproblem in the start screen, I need to extract a date before restoing manafactoring settings

    Hello

    1. What exactly happens when you start?
    2. What is the exact error message you get?

    I suggest you to follow these steps and check if that helps:

    Method 1:
    Try to run the Startup Repair and check if this may help:
    http://Windows.Microsoft.com/en-us/Windows-Vista/startup-repair-frequently-asked-questions

    Method 2:
    Try to restore the computer to system recovery options and check if it helps:
    http://Windows.Microsoft.com/en-us/Windows-Vista/what-are-the-system-recovery-options-in-Windows-Vista

    It will be useful.

  • Foglight v6 - FaultException: impossible to extract the data of inventory of the collector

    After having modernized our virtual center to V4, the foglight fails to report all the details and only has the following alert:
    "FaultException: impossible to extract the data of inventory of the collector: the parameter name cannot be null or an empty string."
    ' Parameter name: key to make sure the collection agent service is running.
    If anyone else has had this problem and how to solve?
    Thank you
    Karim

    Hi Joviyach,
    I logged a call with Vizioncore and the resolution is as follows:
    the problem you have is related to a VMware problem experienced during the upgrade to vSphere 4.0 as detailed in: kb.vmware.com/.../search.do
    Bascially, you must run a SQL command of your Virtual Center via MS SQL Management Studio that will identify one or more VMs who have a missing entry in the VPX_VIRTUAL_SCSICONTROLLER table. Once this information is determined that you would follow the steps 2 to 6 of the reolution... basically remove these virtual machines of the inventory and adding them back.
    When these steps are complete, you will re-start the vFoglight Collector of Vmware and Vmware vFoglight connector services.

  • Extracting the data from QVariantMap

    I have the following data :

    QVariant (QVariantMap, QMap ((' data', QVariant (QVariantMap, QMap ((' current_condition', QVariant (QVariantList, ((QVariantMap, QMap... QVariant QVariant (QVariantMap, QMap ((' weather', QVariant (QVariantList, ((QVariantMap, QMap... QVariant QVariant (QVariantMap, QMap ((' weather_desc', QVariant (QVariantList, ((QVariantMap, QMap... QVariant

    m_model-> insert(data.value() .value ("data") .toMap ().value("weather").toList () .at (0) .toMap ());

    Using the above line, I am able to extract relevant data from "current_condition and"weather".

    What should I add to the line above to also extract data from 'weather_desc '?

    Any help would be appreciated. Thank you.

    Thank you! It is much easier to read when formatted, it's the first thing I did.

    { "data":
      {
        "current_condition":
        [
          {
            "cloudcover": "0",
            "humidity": "18",
            "observation_time": "02:36 AM",
            "precipMM": "0.0",
            "pressure": "1007",
            "temp_C": "39",
            "temp_F": "102",
            "visibility": "10",
            "weatherCode": "113",
            "weatherDesc": [ {"value": "Sunny" } ],
            "weatherIconUrl": [ {"value": "http:\/\/www.worldweatheronline.com\/images\/wsymbols01_png_64\/wsymbol_0001_sunny.png" } ],
            "winddir16Point": "N",
            "winddirDegree": "10",
            "windspeedKmph": "46",
            "windspeedMiles": "29"
          }
        ],
        "request":
        [
          {
            "query": "Melbourne, Australia",
            "type": "City"
          }
        ],
        "weather":
        [
          {
            "date": "2013-01-04",
            "precipMM": "0.0",
            "tempMaxC": "37",
            "tempMaxF": "98",
            "tempMinC": "19",
            "tempMinF": "66",
            "weatherCode": "113",
            "weatherDesc": [ {"value": "Sunny" } ],
            "weatherIconUrl": [ {"value": "http:\/\/www.worldweatheronline.com\/images\/wsymbols01_png_64\/wsymbol_0001_sunny.png" } ],
            "winddir16Point": "N",
            "winddirDegree": "3",
            "winddirection": "N",
            "windspeedKmph": "21",
            "windspeedMiles": "13"
          }
        ]
      }
    }
    

    To access weatherDesc in usage by time:

    Data.value.value("data").toMap ().value("weather").toList () .at (0) .toMap ().value("weatherDesc").toList () .at (0) .toMap .value ("value") ())

    This will return "Sunny."

    For readability, I suggest if this string to:

    QMap  dataMap = data.value().value("data").toMap();
    
    QList weatherList = dataMap..value("weather").toList();
    
    QVariant firstWeatherEntry = weatherList.at(0);
    
    QMap weatherEntryMap = firstWeatherEntry.toMap();
    
    QList weatherDescList =
    weatherEntryMap.value("weatherDesc").toList();
    
    QVariant firstWeatherDescEntry = weatherDescList.at(0);
    
    QMap weatherDescEntryMap = firstWeatherDescEntry.toMap();
    
    QString value = weatherDescEntryMap.value("value").toString(); // "Sunny"
    

    Also, you can check intermediate outcomes at each stage by calling

    qDebug()< weatherlist="">< "\n";="" and="" so="">

  • Hi, after all stages of extraction of data from oracle to oracle during the execution of command "start extract ext1" his error giving the Manager does not work, can you please help me. Thank you

    Hi, after all stages of extraction of data from oracle to oracle during the execution of command "start extract ext1" his error giving this handler does not run both source and target, can you please help me. Thank you

    Hello

    The setting should be as below, and not only the port number should be...

    PORT 7809

    Kind regards

    Veera

  • Extraction of data from XMLType field

    Sorry, I am not sure XMLQuery, this is probably a simple question.  I am trying to extract data in a tabular form of an XMLTYPE field.  I will use the following example to illustrate my question:

    WITH a (too)

    Select xmltype (')

    < bugStatus >

    < status >

    < > 111 bugCode < / bugCode >

    < number of bug = "12345" description = "Low severity bug" / >

    < / status >

    < status >

    < > 222 bugCode < / bugCode >

    < number of bug = "67890" description = "high severity bug" / >

    < / status >

    < / bugStatus >

    XMLDATA') of double)

    SELECT x.*

    A xmltable (' bugStatus/status

    by the way the columns in a.xmldata

    status_code number path "bugCode.

    ) x ;

    Run this code extracts block the "bugCode' fields successfully.  But I would also to extract the 'bug number' and 'description' fields.  Ideally in the independent columns.  But even if only as a single line 'number of bug =... description =... ". "I could still do it analyze with SQL.

    Can someone tell me please in the sense of how I can also extract additional data?

    Thank you!

    Attributes are processed by '@' so in your example (thank you), you can solve it through

    WITH a (too)

    Select xmltype (')

    111

    222

    XMLDATA') of double)

    SELECT x.*

    A xmltable (' bugStatus/status

    PASSAGE a.xmldata

    COLUMNS

    ROW_NUMBER for ordinalite,

    path number bugCode "bugCode."

    bugNumber path number "bug/@number."

    path of varchar2 (4000) bugDescription 'bug/@description '.

    ) x ;

    ROW_NUMBER BUGCODE BUGNUMBER BUGDESCRIPTION

    ---------- ---------- ---------- --------------------------------------------------

    1 111 12345 low severity bug

    2 222 67890 high severity bug

  • extract xml data in the collection

    Hello

    I want to extract xml data in a collection of collection


    could any body you tell me if we succeed in sql
    ex:

    declare
    type t_code is table of number;
    type r_rec is record (c_name varchar2 (100),)
    c_code vrachar2 (100),
    c_code_number t_code);
    type t_rec is the table of the r_rec;

    l_xml xmltype: = xmltype (')

    < body >
    <>campaign
    < code > < code > CAMP_1
    < description > Campaign_1 < / description >
    < rateplans >
    < rateplanCode > 1 < / rateplanCode >
    < rateplanCode > 2 < / rateplanCode >
    < rateplanCode > 3 < / rateplanCode >
    < / rateplans >
    < / campaign >
    <>campaign
    < code > < code > CAMP_2
    < description > Campaign_2 < / description >
    < rateplans >
    < > 11 rateplanCode < / rateplanCode >
    < > 22 rateplanCode < / rateplanCode >
    < rateplanCode > 33 < / rateplanCode >
    < / rateplans >
    < / campaign >
    <>campaign
    < code > < code > CAMP_3
    < description > Campaign_3 < / description >
    < rateplans >
    < > 111 rateplanCode < / rateplanCode >
    < > 222 rateplanCode < / rateplanCode >
    < > 333 rateplanCode < / rateplanCode >
    < / rateplans >
    < / campaign >
    < result >
    < > 00 resultCode < / resultCode >
    < resultText > success < / resultText >
    < / result >
    (< / body > ');

    Start

    Select / * logic exrat value of xml in the final collection * /.
    Double;

    end;

    I want data in the model in my final collection t_rec

    CAMP_1, Campaign_1, nested_table (1,2,3)
    CAMP_2, Campaign_2, nested_table (11,22,33)
    CAMP_3, Campaign_3, nested_table (111,222,333)

    Published by: 948596 on May 17, 2013 05:17

    Like this

    SQL> declare
      2       type t_code is table of number ;
      3       type r_rec is record
      4       (
      5          c_name varchar2(100),
      6          c_code varchar2(100),
      7          c_code_number t_code
      8       );
      9       type t_rec is table of r_rec ;
     10       l_rec t_rec := t_rec();
     11       l_xml xmltype := xmltype
     12                        ('
     13                           
     14                           
     15                           CAMP_1
     16                           Campaign_1
     17                           
     18                           1
     19                           2
     20                           3
     21                           
     22                           
     23                           
     24                           CAMP_2
     25                           Campaign_2
     26                           
     27                           11
     28                           22
     29                           33
     30                           
     31                           
     32                           
     33                           CAMP_3
     34                           Campaign_3
     35                           
     36                           111
     37                           222
     38                           333
     39                           
     40                           
     41                           
     42                           00
     43                           Success
     44                           
     45                           '
     46                        ) ;
     47  begin
     48       for i in (
     49                 select rownum id
     50                      , t1.code
     51                      , t1.description
     52                      , t2.rate_plan_code
     53                      , row_number() over(partition by t1.code order by t2.rate_plan_code) rno
     54                   from xmltable
     55                        (
     56                             '/body/campaign' passing l_xml
     57                             columns
     58                               code        varchar2(100) path 'code',
     59                               description varchar2(100) path 'description',
     60                               rate_plans  xmltype       path 'rateplans'
     61                        ) t1
     62                      , xmltable
     63                        (
     64                             '/rateplans/rateplanCode' passing t1.rate_plans
     65                             columns
     66                               rate_plan_code varchar2(100) path '.'
     67                        ) t2
     68                )
     69       loop
     70            if i.rno = 1 then
     71               l_rec.extend;
     72               l_rec(l_rec.count).c_name := i.description;
     73               l_rec(l_rec.count).c_code := i.code;
     74               l_rec(l_rec.count).c_code_number := t_code();
     75            end if;
     76            l_rec(l_rec.count).c_code_number.extend;
     77            l_rec(l_rec.count).c_code_number(i.rno) := i.rate_plan_code;
     78       end loop;
     79       for i in 1..l_rec.count
     80       loop
     81          dbms_output.put_line(l_rec(i).c_code || '  ' || l_rec(i).c_name);
     82          for j in 1..l_rec(i).c_code_number.count
     83          loop
     84             dbms_output.put_line(l_rec(i).c_code_number(j));
     85          end loop;
     86       end loop;
     87  end;
     88  /
    CAMP_1  Campaign_1
    1
    2
    3
    CAMP_2  Campaign_2
    11
    22
    33
    CAMP_3  Campaign_3
    111
    222
    333
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    
  • Extracting the data from relational tables in 11.1.2.1

    I want to extract the following data sets from relational tables
    1 attribute and his partner basic member
    2 Smartlist value of an account

    Have a code to extract such data? It will be useful in pointing to the correct table names.

    Thank you

    You will find the table schemas in the [documentation for EPMA | http://www.oracle.com/technetwork/middleware/bi-foundation/epm-data-models-11121-354684.zip]. If this does not work, there are other options to export hierarchies in text files. You can use the lifecycle management or the [EPMA line Generator | http://docs.oracle.com/cd/E17236_01/epm.1112/epma_file_gen_user/launch.html].

    Kyle Goodfriend
    http://www.in2hyperion.com

    Please make sure that you assign your post as answered when an appropriate response is provided (or useful when it takes place) as well as other benefits.

  • extract the date year

    Hello

    IAM using obiee 11g, hold extract the date year
    CAST (YEAR ("ABC". "DATEADDED") as varchar (4)) "
    so used like that

    But I want as if the year is 11 2011 then only I want y at - it a direct function that does this.

    Thank you

    You can use the right right function (year 2). Will return 11 if the year 2011

Maybe you are looking for

  • No service/network research once ios 10 updated

    IPhone 5s not most of the time after updating ios 10.0.1 looking for network and service. Updated 25.2 TMobile no help either. When we have corrected update for this?

  • Foxfire runs when "Pac Man" plays continuously. How to stop it?

    It started this morning for the first time. He plays when Foxfire is activated, not with IExplorer. Foxfire runs when "Pac Man" plays continuously. How to stop it? This has happened Each time Firefox opened NA User Agent Mozilla/4.0 (compatible; MSIE

  • XP does not start at the logon screen

    Original title: XP will not boot: When I try to start Windows XP, the computer stops responding it hangsup lack of a better word with a black blank screen immediately after that the windows logo splash screen is complete. Usually after the logo splas

  • How to locate the "sendto" folder in vista

    Hi there; I tried to find the folder sendto in windows vista, so that I can add places him. I tried 'help and support' and the 'Run' feature as well as through the entire Panel, without success. I could always find in XP but not Vista, I'm logged on

  • 10.9.2 Wireless for HP Officejet 4620 does not

    MacBook Air printing on HP Officejet 4622 ceased print wireless.   When plugged up - printgs perfect - when you use wirelss I get printer not connected.    Currently with labtop HP wireless printers, phone Samsung and IPAD to work.