A
|id |title |comment|
-------------------------
|1 |100001 |blabla |
|2 |100002 |bububu |
|3 |100003 |bababa |
B
|cid |pid |val |
------------------------
|1 |6 |34763 |
|1 |14 |Lenin |
|1 |15 |uhuh |
|2 |14 |ufimsk |
|3 |6 |5376 |
|3 |15 |sofof |
Select title, comment, val from A left join И ON cid=id AND pid=14
|