• You can't do that directly.

    You could do it with dynamic code, but you need to be careful of SQL injection.

    The best way to achieve it is to redesign you database (I'm sure it's not the easiest or the most likely).

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2