Pass the results of a mysql query to a subquery on the same table

advertisements
CREATE TABLE test (
id INT(12),
time VARCHAR(16),
group INT(2),
taken TINYINT(1),
RID int(11) NOT NULL auto_increment,
primary KEY (RID));

id | time | group | taken
---------------------------
1  | 13.00|   1   |   1
---------------------------
2  | 13.00|   2   |   0
---------------------------
3  | 14.00|   2   |   0
---------------------------
4  | 15.00|   2   |   0
---------------------------
5  | 12.00|   3   |   0

Having a table structure and sample data as above, I want to get the smallest "group" number which has not been "taken" (taken=0)

I have come with two queries :

SELECT * From `test`
WHERE taken=0

and

SELECT * FROM `test`
WHERE `group` =  ( SELECT MIN(`group`) FROM `test` )

Can someone show me how to combine the two queries so that I can pass the results of the first query to the second query to get as below.

id | time | group | taken
---------------------------
2  | 13.00|   2   |   0
---------------------------
3  | 14.00|   2   |   0
---------------------------
4  | 15.00|   2   |   0
---------------------------


You can use the result of the first query in the second query as follows:

SELECT *
FROM TEST
WHERE `group` = (SELECT MIN(`group`)
                 FROM `test`
                 WHERE taken = 0)

Which gives you the desired result according to this SQLFiddle