在我的项目(在线购物网站)中,我有一个类似 Flipkart 网站的搜索框。输入搜索关键字后,4个表格的结果将显示在一个页面中。
Table : `tbl_product`
Field : `id`,`date`,`title`,`model_no`,`quantity`,`category_id`,`brand_id`,`color`,`size`
Table : `tbl_brand`
Field : `id`,`date`,`brand_name`,`category_id`,`description`
Table : `tbl_category`
Field : `id`,`date`,`category_title`, `description`
Table : `tbl_product_specification`
Field : `id`, `date`, `product_id`,`specification_title`
现在,我想得到 $keyword 变量的搜索结果:
`title`,`model_no` from `tbl_product`
`brand_name` from `tbl_brand`
`category_title` from `tbl_category`
`specification_title` from `tbl_product_specification`
我不擅长 MySQL SQL 查询。那么,什么 SQL 会完成这个呢?