# \[SQL\] Evaluations of table names

**URL:** <https://forum.kirupa.com/t/sql-evaluations-of-table-names/191997>\
**Category:** Uncategorized\
**Created:** [June 24, 2006, 10:03pm UTC](https://forum.kirupa.com/t/sql-evaluations-of-table-names/191997 "2006-06-24T22:03:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![icio](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/icio/32/484_2.png) [@icio](https://forum.kirupa.com/u/icio)\
**Post date:** [June 24, 2006, 10:03pm UTC](https://forum.kirupa.com/t/sql-evaluations-of-table-names/191997/1 "2006-06-24T22:03:23Z")

</div>

MySQL 4.1.13a-nt.

I have a few tables set up in my database. The main of which is called `products` which stores information about each product, including their product identification number (`pid`) and their product type (`type`, in this case, ‘shower’ or ‘boiler’).

I have 2 other tables named `products_showers` and `products_boilers` which store tech specs of each product, depending on whether that product is a shower/boiler.

Here’s a theoretical statement of what I’m trying to achieve (but it generates errors)

```auto
mysql> SELECT
    -> *
    -> FROM
    -> products,
    -> CONCAT("products_",products.type,"s") as products_tech
    -> WHERE
    -> products.pid=products_tech.pid
    -> AND
    -> products.pid='10';

```

Is there any way that I can do this validly or am I going to need to use PHP to find the type from `products` to evaluate that I need to take the tech specs from `products_showers`/`products_boilers`?

Thanks =)
