When querying with mysql join, how can the data be displayed when the value is 0?

the personal table has a companyid field, which is associated with the id field in the company table

query the personal statement as follows:

$list = Db::name("personal")
                ->alias("a")
                ->field("a.*,b.title as companytitle")
                ->join("company b","a.companyid = b.id")
                ->order("id desc")
                ->paginate($limit);

if the personal table has a companyid field of 0, then there is no data to display. How can the data be displayed when it is 0?

Sep.23,2021

LeftJoin ()

Menu