I have table with following structure:
|id|author_id|name|type|created_at|updated_at
As a type I can have 5 different types, (A, B, C, D, E).
I need a query DB by author_id where I can select only last updated row "type" A and B. And select all other type rows.
So the result should be something like:
| id | author_id | name | type | created_at | updated_at
| 12 | 88 | lorem | A
| 45 | 88 | lorem | B
| 44 | 88 | lorem | C
| 154 | 88 | lorem | C
| 98 | 88 | lorem | C
| 856 | 88 | lorem | E
| 857 | 88 | lorem | E
Is it possible with single query? Or I need to use two queries?
Thank you