Answer the question
In order to leave comments, you need to log in
SQL how to make a query(s) in this situation?
There is a table of goods objects (sports store). It contains the main fields common to all types of goods. There are several tables-types of objects (shirts, shoes, ... sports pit) that are "inherited" from the main table. A relationship between an object in the underlying table and a one-to-one table type. In the main table there is a field "type"
$q = '
SELECT
*
FROM
catalog_product prod
INNER JOIN
catalog_product_type_shirt prod_type
ON
prod.id=prod_type.product_id';
Answer the question
In order to leave comments, you need to log in
It depends on what to consider in dirty ways. Some out there rewrite engines for the sake of performance, or even develop their own DBMS.
And so it is possible through IF and subqueries, for example.
stackoverflow.com/questions/17723808/mysql-if-stat...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question