You can use placeholders; in fact the [+DATABASE+] and [+PREFIX+] placeholders are already set for you:
@SELECT * FROM [+PREFIX+]tablename ...
so you could use a snippet to set the value you want as a placeholder.
You cannot use chunks or TVs, although you can use a TV to set a placeholder:
@EVAL $modx->setPlaceholder('placeholdername', 'value');
Just make sure your snippet or TV is called before your @SELECT TV so the placeholder is available.
You could also use a plugin, but then things start getting complicated.