How can I prevent inner SELECT from returning NULL (when matches no rows) and force query to fail.
INSERT INTO tt (t1_id, t2_id) VALUES (
(SELECT id FROM t1 WHERE ...),
(SELECT id FROM t2 WHERE ...)
);
Side question: is there better way form this query (t1_id, t2_id are foreign keys, but might be NULL) ?