Question: I am making a music classification database using PHP and MySQL.
I have three tables:

**Song:**

```
ID  | Title
------------------------
1   | Example Song

```

**Genre:**

```
ID  | Name
------------------------
1   | Classical
2   | Instrumental

```

**SongGenre**

```
SongID | GenreID
----------------
1      | 1
1      | 2

```

My Query is:

```
SELECT s.title, GROUP_CONCAT(DISTINCT g.name SEPARATOR ', ')
FROM song s    
LEFT JOIN songgenre sg ON s.id=sg.s_id
LEFT JOIN genre g ON sg.genreid = g.id

```

I'm using GROUP\_CONCAT to allow for multiple genres as shown:

> 
> Title: "Example Song" Genres: Classical, Instrumental
> 
> 
> 

I wish to generate a link in PHP for each genre, so that if the user clicks on "Classical" they are brought to more songs listed as Classical. The issue is, I am unsure how to give each genre its' own link. The issue with GROUP\_CONCAT is that both genres are returned together in the same row, and I am unsure how to **split the row apart to add a link to each separate genre.**

Answer: 
It's possible to use the NetCDF-java library to open GRIB files: <https://www.unidata.ucar.edu/software/thredds/current/netcdf-java/documentation.htm>
Ok, i made something using NetCDF. For my usage it seems to be enough. Of course for each grib variables will be different.

```
try {
           NetcdfFile ncf = NetcdfFile.open("gribfilename.grb"); //loading grib file
           System.out.println("Variable names are:");
           List<Variable> vars = ncf.getVariables();    //listing variables
           for (Variable var : vars) {
             System.out.println(var.getName());
           }

           Variable Uwind = ncf.findVariable("u-component_of_wind_height_above_ground");
           Variable Vwind = ncf.findVariable("v-component_of_wind_height_above_ground");
           Variable lat = ncf.findVariable("lat");
           Variable lon = ncf.findVariable("lon");
           Variable time = ncf.findVariable("time");
           Variable reftime = ncf.findVariable("reftime");
           Variable reftime_ISO = ncf.findVariable("reftime_ISO");
           Variable height_above_ground = ncf.findVariable("height_above_ground");
           Variable height_above_ground1 = ncf.findVariable("height_above_ground1");
           Variable Temperature_height_above_ground = ncf.findVariable("Temperature_height_above_ground");
           Variable Pressure_reduced_to_MSL_msl = ncf.findVariable("Pressure_reduced_to_MSL_msl");

           Array u_data = Uwind.read(); //reading variables to Array type
           Array v_data = Vwind.read();
           Array lat_data = lat.read();
           Array lon_data = lon.read();
           Array time_data = time.read();
           Array reftime_data = reftime.read();
           Array reftime_ISO_data = reftime_ISO.read();
           Array height_above_ground_data = height_above_ground.read();
           Array height_above_ground1_data = height_above_ground1.read();
           Array Temperature_height_above_ground_data = Temperature_height_above_ground.read();
           Array Pressure_reduced_to_MSL_msl_data = Pressure_reduced_to_MSL_msl.read();

           ncf.close();

    } 
    catch (Exception exc) {
        exc.printStackTrace();
    }

```