I use breezingform for joomla to create web form, which store user input records in database as below:

**forms\_records** 

```
id  | form  | name          
24    19       kpi          
25    19       kpi  

```

**forms\_subrecords** 

```
id   | element  | record    | description  |  value  | type
101     406        24          month         2015-01   calendar
102     407        24          east          30%       text
103     408        24          south         35%       text
104     409        24          north         50%       text
105     410        24          west          25%       text
106     406        25          month         2015-02   calendar
107     407        25          east          45%       text
108     408        25          south         35%       text
109     409        25          north         15%       text
110     410        25          west          5%        text

```

I tried do it in:
1. get record id first

```
SELECT id FROM forms_records WHERE form='19'

```

2. get subrecords value

> 
> 
> ```
> SELECT s.value 
> from forms_subrecords AS s 
> WHERE s.record 
>   IN (SELECT id FROM forms_records WHERE form='19')
> 
> ```
> 
> 

the result are 10 rows with one column, 

```
2015-01
30%
35%
50%
25%
2015-02
45%
35%
15%
5%

```

but what I want are 2 rows with 5 columns:

```
2015-01 30% 35% 50% 25% 
2015-02 45% 35% 15% 5%  

```

anyone can help or give some hints?