wild cards for table names in a MySQL select statement
| From: | Michael Hall | Date: | Fri, 17 Nov 2000 21:35:14 +0000 |
| Subject: | wild cards for table names in a MySQL select statement | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-4518@lists.php.net to get a copy of this message | ||
This question is born of sheer laziness, but an answer may be lurking out
there.
We have a MySQL table that lists prices. There are 47 columns that begin
with "WS" (for wholesale prices), and 47 corresponding columns that begin
with "RT" (for retail prices).
What we would like to do to avoid writing them all out everyplace, is to
select all fields starting with "WS" or all fields starting with "RT".
It's not a big deal, but it would be quite convenient if we could use some
sort of wild card in the SELECT statement.
We've tried "SELECT lsp_size_price.WS%" and "SELECT lsp_size_price.WS*"
(two
logical choices) but they only give us syntax errors.
If anyone could help us out, it would be appreciated.
Michael Hall
Database Engineer
Prairie Fire Web Design
mike@prairiefirewebdesign.com