How to join to tables, if I prefer to get records only from the second table? If no second exists, take record the of the first table.
Table A Table B Result
pid,name,type pid,name,type pid,name,type
1,Anna,null 1,Anna,100 "1,Anna,100"
2,Bea,null - "2,Bea,Null"
3,Caro,null 3,Caro,100 "3,Caro,100"
3,Caro,200 "3,Caro,200"
Edit: I tried to improve my example table.
Edit, I’m assuming you’d have no row in tableA, and “Dave, 6” in tableB. Otherwise, Cybernate’s left join is enough