我有multipe表+不同領域,我嘗試做這樣的事情:指定自定義行值
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
爲title
而且編程問題是...? – KingCrunch
使用'concate':http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_concat – GBD