3 ms·
If you want the table as a variable, you would need to use a prepared statement: PREPARE stmt1 FROM 'SELECT X.* FROM ? X, user WHERE X.user_id = user.user_
by tkyjonathan 10y ago
If you want the table as a variable, you would need to use a prepared statement:
PREPARE stmt1 FROM 'SELECT X.*
FROM ? X, user
WHERE X.user_id = user.user_id
AND (X.permission OR user.is_super)';
EXECUTE stmt1 USING 'yourtable';