User Tools

Site Tools


wiki:join_table_multiple_times

Join table multiple times

SELECT DISTINCT columnAAA,name,bf1.columnBBB,bf2.columnBBB
FROM table1 AS bt
LEFT JOIN table_to_join AS bf1 ON bt.columnAAA=bf1.columnCCC
LEFT JOIN table_to_join AS bf2 ON bt.columnAAA=bf2.columnDDD
INTO OUTFILE '/var/lib/mysql-files/table1.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n';

Tested on

See also

References

wiki/join_table_multiple_times.txt · Last modified: 2021/04/28 16:29 by antisa

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki