tags:

views:

31

answers:

2
    EMAIL                EML_GRP   
  -------                 -----      

[email protected]            1,2,3

[email protected]              1,4,5

This is the table structure. How do I parse the values in the EML_GRP field? I am using mySQL.

A: 

Assuming (1) you use Java language and (2) you already submitted a query and read the values from a ResultSet, then you might have two Strings per record

String email = "[email protected]";  // just to demonstrate
String eml_grp = "1,2,3";

To get the numbers out of eml_grp, you can use the String.split mehtod:

String[] numbers = eml_grp.split(",");
Andreas_D