INSERT INTO `test_db_vytrat` (`id`, `user_id`, `data`, `cat`, `oper`, `suma_oper`, `balans`, `note`)
SELECT NULL as id, '{$_POST[uid]}' as user_id, '{$_POST[data]}' as data, ..., balans+1000 as balans, '{$_POST[note]}' as note from test_db_vytrat where user_id = 1 ORDER BY `id` DESC LIMIT 0 , 1;
SELECT * FROM
(SELECT DISTINCT position FROM paragraph
UNION
SELECT DISTINCT position FROM figure
) t1
LEFT JOIN paragraph USING (position)
LEFT JOIN figure USING (position)