Say you have a dynamic view of a table that consists of the following entries

```
| id | type |
| 1  | cat  |
| 2  | dog  |
| 3  | bunny|

```

The catch with this is that sometimes there may not be an `id` with a `type` of `"cat"` it could potentially look like

```
| id | type |
| 1  | dog  |
| 2  | bunny|

```

How would one write a query for this table to select a single row based on precedence of `type`.

For example, if the ranking of `type` was `cat > dog > bunny`, I would want the first entry from that table with the highest ranking condition.

If we call our view `pets`, which has `ORDER BY id ASC` then we would have a query that looks something like this

```
SELECT *
FROM pets
WHERE type = 'cat' > 'dog' > 'bunny' -- here is where I need help
LIMIT 1

```

I've tried things like

```
IF EXISTS (SELECT * 
       FROM   pets 
       WHERE  type = "cat") 

THEN SELECT * FROM pets WHERE condition = "cat" LIMIT 1
-- etc... down the ranking 

```

Can't seem to get this to work though. Help is much appreciated.