i have 5 tables in my database with same table structure
am trying to select from all the tables with like keyword
then am getting an erro
the error is
Column 'TitleLine' in where clause is ambiguous
the query am executing is
select * from equitymarketnews,economynews,corporatenews,industrynews where TitleLine Like '%axis Bank%' OR StoryMain like '%axis Bank%';
can anyone tell me where am doing wrong ?
i know this can be done BY UNION
can anyone give me example ?
You probably don’t want to design your tables like that but when you have the same named column and it could refer to either table you need to do tableName.columnName to make mysql understand. For a union, just break each of them into its own select then union them together like so (all one statement)
here is a good start on union