I have three tables with the same structure, tab1, tab2, and tab3, which all have the fields col1, col2, and col3. The original use statement (select * fromtab1wherecol1 & #39; $ wd & #39; orcol2LIKE & #39; $ wd % & #39;) unionall (select * fromtab1wherecol1 & #39; $ wd & #39; orcol2LIKE & #39; $ wd % & #39;) unionall (select * fromtab1w joint query mysql multi-table query
I originally had several tab1, tab2, and tab3 tables with the same structure.
All three tables have fields.
Col1, col2, col3
Original statement
(Select * from tab1 where col1 = '$ wd' or col2 LIKE '$ wd % ')
Union all
(Select * from tab1 where col1 = '$ wd' or col2 LIKE '$ wd % ')
Union all
(Select * from tab1 where col1 = '$ wd' or col2 LIKE '$ wd %') LIMIT 0, 20 ";
Queried
Now we have added a table with tab4 fields and col4 fields.
Namely: col1, col2, col3, col4
Use the preceding statement to add more
(Select * from tab4 where col1 = '$ wd' or col2 LIKE '$ wd % ')
Union all
After query prompt
Invalid query: The used SELECT statements have a different number of columns
Is there any statement that can be properly queried with the newly added tab4?