I have two tables which I want to connect.
+-----------+-----------+---------+ | row_id | category | val_1 | +-----------+----------
Try an outer join.
SELECT TABLE_A.row_id, TABLE_A.category, TABLE_A.val_1, TABLE_B.val_2 FROM TABLE_B LEFT OUTER JOIN TABLE_A ON TABLE_B.row_id = TABLE_A.row_id ORDER BY row_id;