The only reason it wouldn't work is if you have specified a table prefix in your config.php file.
For example if your table prefix is: vb_
Then the code would be:
Code:
DELETE FROM vb_post WHERE visible = 2
I see no reason why it wouldn't work on VB4 but if your question is about VB4 I suggest asking in the VB4 forum.
Also as this is a database edit, even 1 small typo could wipe out your entire forum, so make sure you have a backup before you try this- this is not a suggestion it is a FACT.