I have a system used for exhibition in Website.
The exhibition data maybe from multi-data in difference table.
Like this design:
Table [ExhibitionType] used for differentiate category.
Table [ExhibitionBase] used for link extra Sub-Type table & data in different table.
My website use MySQL and PHP
Now question is I DON'T KNOW how to query it. or this design have a flaw.
EDIT 1:
I'm sorry I didn't express my intentions.
Example: I hope query a data list. first i need filter ExhibitionType
like 1.
So i need create a SQL like : SELECT * FROM ExhibitionBase WHERE ExhibitionTypeId = 1
And second step i must read ExhibitionDataType
and ExhibitionDataId
each row data. And according to the different types of ExhibitionData
data out to merge into the ExhibitionBase
Sub-tables.
HOW TO DO use SQL query it.
This my question.
SELECT b.*, dt.Name, di.name
FROM ExhibitionBase AS b
JOIN ExhibitionDataType AS dt ON dt.id = b.ExhibitionDataType
JOIN ExhibitionDataId AS di ON di.id = b.ExhibitionDataId
WHERE ExhibitionTypeId = 1
Style suggestions:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.