Hello,
I'm newbie at sql, Im trying to get results from a query getting the last state an issue is. This are my 2 tables:
Table 1 : issues
id_issue
name_issue
data_issue
Table 2: hist_issues
id_hist
id_issue (have relation with issues.id_issue 1-to-many)
state
who
date_time
Well, Im using hist for save all the states where the issue is (received, in process and closed). There is a one to many relation with that 2 tables. The thing I want is make a select that returns me the data of the last state where the issue is.
I tryed with a select distinct but it use the id of the hist_issues and I need that use the id of issues table, and take the one with date next to present.
Thanks in advance.