I have two tables in a master/detail relationship. Is it possible to use a query to join them so that it returns all of the master records and the LAST entry of any detail records associated with it, determined by date?
This would answer the question 'show me all our salesmen, along with details of the last time they visited a customer', assuming that your detail table kept visit info.
I can use MAX() to return just the detail table Date, but I want the rest of the detail table fields as well. I suspect that I could use nested queries, but my version of MySQL does not support them.
Thanks.
This would answer the question 'show me all our salesmen, along with details of the last time they visited a customer', assuming that your detail table kept visit info.
I can use MAX() to return just the detail table Date, but I want the rest of the detail table fields as well. I suspect that I could use nested queries, but my version of MySQL does not support them.
Thanks.