09-18-2013, 03:26 PM
is it possible to do a subselect in mysql with two different db?
|
subselect
|
|
09-18-2013, 03:26 PM
is it possible to do a subselect in mysql with two different db?
09-18-2013, 03:49 PM
Sure thats possible SELECT s.a_keeper_idx as npcid, n.a_name_usa as npcname, i.a_name_usa as itemname, i.a_price FROM t_shopitem s, t_item i, t_npc n WHERE s.a_item_idx = i.a_index AND n.a_index = s.a_keeper_idx ORDER BY s.a_keeper_idx
09-18-2013, 04:00 PM
s, n, i | are the names db?
09-18-2013, 04:12 PM
t_shopitem s, t_item i, t_npc n SELECT s.a_keeper_idx as npcid, n.a_name_usa as npcname, i.a_name_usa as itemname, i.a_price FROM emunew_data.t_shopitem s, test_data.t_item i, test_data.t_npc n WHERE s.a_item_idx = i.a_index change emunew_data and test_data to your database names
09-18-2013, 04:42 PM
s n i are just like shortcuts defined in the FROM section. U could also write it like this SELECTt_shopitem.a_keeper_idx as npcid,t_npc.a_name_usa as npcname,t_item.a_name_usa as itemname,t_item.a_priceFROMt_shopitem,t_item,t_npcWHEREt_shopitem.a_item_idx = t_item.a_indexANDt_npc.a_index = t_shopitem.a_keeper_idx
09-18-2013, 05:11 PM
ok ill try
09-20-2013, 11:57 PM
solved thanks
09-21-2013, 12:43 PM
Closed and moved.
|
|
« Next Oldest | Next Newest »
|