I have two tables and I have to join it. table structures are
tblproducts --> id(int,pk), name(varchar)
tblphotos ---> id(int,pk), productid(int,fk), photo(varchar), display_order(int)
There can be more than one photos for each product, I need to get one photo with lowest display_order.
I need, tblproducts.id, tblproducts.name, tblphotos.photo(photo with least display_order) also I need to get the whole list as tblproducts.id in ascending order.