I was wondering, what is the most efficient way of combining results into a single result.

I want to turn

```
Num  Ani   Country
---- ----- -------
22   cows  Canada
20   pigs  Canada
40   cows  USA
34   pigs  USA

```

into:

```
cows  pigs  Country
----- ----- -------
22    20    Canada
40    34    USA

```

I want to know if it would be better to use SQL only or if I should feed the whole query result set to the user. Once given to the user, I could use JavaScript to parse it into the desired format.

Also, I do not know exactly how I would change this into the right format for a SQL query. The only way I can think of approaching this SQL statement is very roundabout with dynamically creating a temporary table.