How do you select all the columns from one table and just some columns from another table using JOIN? In MySQL.
A MySQL SELECT statement is used to retrieve data from a MySQL table. To exclude certain column(s) from the SELECT statement result, you can omit the column/ field name from the query.
Just use the table name:
SELECT myTable.*, otherTable.foo, otherTable.bar...
That would select all columns from myTable
and columns foo
and bar
from otherTable
.
I need more information really but it will be along the lines of..
SELECT table1.*, table2.col1, table2.col3 FROM table1 JOIN table2 USING(id)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With