Imagine the following table:

```
| my_id | my_status |        my_title |               my_desc |
|-------|-----------|-----------------|-----------------------|
|     1 |         N |     Hello World | This is a description |
|     2 |         N |     Hello again |             Blah blah |
|     3 |         N |     This is fun |  I like StackExchange |
|     3 |         E | This edited fun |  I love StackExchange |
|     4 |         N |         Goodbye |     Last record here. |

```

Normal records have "N" in the my\_status column. When an entry is edited, I created a new record marked with "E". Once an edit is approved, I delete the original N record and update the E record to be an N record. It's basically an edit approval system.

Now I want to query that table and show records with a unique id that are marked with 'E' if they exist, otherwise return the standard 'N' record. So the ultimate result should be:

```
| my_id | my_status |        my_title |               my_desc |
|-------|-----------|-----------------|-----------------------|
|     1 |         N |     Hello World | This is a description |
|     2 |         N |     Hello again |             Blah blah |
|     3 |         E | This edited fun |  I love StackExchange |
|     4 |         N |         Goodbye |     Last record here. |

```

I am sure this must be possible in one query but it is eluding me right now. (It's Friday afternoon, 33 degrees in the office and my brain is melting).

I am imagining something like

```
SELECT * FROM my_table WHERE IF EXISTS (my_status='E') ELSE (my_status='N') 

```

(I know that's not valid SQL but it hopefully indicates the gist of what I want to achieve).

SQL Fiddle here: <http://sqlfiddle.com/#!9/1b049/1>