I have two tables. One is a master table containing master data.
One column contains unique IDs. A second is a log table.
For one unique ID (master table ID) nearly 3 to 4 records are in the log table.
I want to fetch master data and its log table data (top record for unique id in descending order).
Eg.
Master table
id guid desc depid
-----------------------------
1 fg1 hii 1
2 h6 hoo 2
Log table
id guid fromqueue toqueue status
-----------------------------------------------
1 fg1 1 2 1
2 fg1 2 3 2
3 h6 1 4 2
4 h6 4 5 3
For example, here I want to fetch data like below
id guid desc depid status
-----------------------------------------------
1 fg1 hii 1 2
2 h6 hoo 2 3
What is the query for getting this result?