I am having multipe tables + different fields and I try to do something like this:
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'
I mean I want to add a row with its value during select on the fly.
Another one I want to combine two fields into one like manufacturer+model as title
CONCAT (manufacturer, model) as content