我有多个表+不同的字段,我尝试做这样的事情:
SELECT
`title` as title,
`manufacturer`+`model` as content /* I want to achieve this as well */
`type` = 'auto_table' /* custom variable w/ value auto_table to know from where is this data*/
FROM `auto`
WHERE `title` LIKE '%bmw%'
OR
`manufacturer` LIKE '%bmw'
OR
`other_data` LIKE '%bmw'
UNION
SELECT
`title` as title,
`content` as content
`type` = 'news_page' /* custom variable w/ value news_page to know from where is this data*/
FROM `news`
WHERE `title` LIKE '%bmw%'
OR
`content` LIKE '%bmw'
我的意思是我想在动态选择期间添加一行及其值。另一个我想将两个字段组合成一个像manufacturer
+ model
astitle