java - One statement to select data from two MySQL tables. Show name instead of/by ID -
i have 2 tables
the table .issues looks this:
id tracker_id project_id 22 1 218 in second table .trackers:
id name 1 error is possible make 1 select request receive result names of trackers instead of/with ids? need simplify java request.
i want smth this:
id (tracker_id) project_id tracker_name 22 (1) 218 error i tried this, know doesn't make sense:
statement stmt1 = conn.createstatement(); resultset ticketsrows = stmt1.executequery("select * issues tracker_id in (select id trackers)");
join trackers table , select name column table instead tracker_id
select i.id, t.name tracker_name, i.project_id issues join trackers t on i.tracker_id = t.id
Comments
Post a Comment