php - Medoo Syntax for Join Query with Two Foreign Keys -
i've requirement perform join operation in sql 2 foreign keys on same table. answer in below post has sql requirement.
join on 2 foreign keys same table in sql
i trying convert query medoo syntax, don't desired output. code posted below latest effort doesn't work.
$db -> select( "item_tbl", [ "[>]user_tbl.id" => ["ownerid", "lastmodifiedbyid"] ], ["username", "username", "itemname"]);
could please help?
i've framed medoo syntax myself using aliases. below medoo equivalent code above sql:
$db->select("item_tbl",["[><]user_tbl(user_tbl_a)" => ["item_tbl.ownerid" => "id"],"[><]user_tbl(user_tbl_b)" => ["item_tbl.lastmodifiedbyid" => "id"]],["user_tbl_a.username(owner)","user_tbl_b.username(modifier)","itemname"]);
Comments
Post a Comment