How to join more three table in mysql
MySQL is a free open-source relational database management system (RDBMS) that supports SQL (Structured Query Language). It was originally developed by Oracle Corporation but has since been released under the GPL license.MySQL is widely used in many different areas including web hosting, e-commerce, online publishing, social networking, and software configuration management. beside Mysql you can use
1.
MariaDB
MariaDB is a community-developed fork of MySQL. It is based on
the same code base but is licensed under the GNU General Public License (GPL)
version 2.0.
2. PostgreSQL
PostgreSQL is a powerful object-relational database management
system (ORDBMS) that supports ACID transactions and foreign keys. It is a
commercial product from PostgreSQL Global Development Group (PGDG), formerly
known as Postgres Software Inc.
2.tb_order_detail
SELECT
o.oid,
p.pname,
od.quantity,
od.unit_price
FROM
tb_orders o
LEFT JOIN tb_order_detail od ON od.oid = o.oid
LEFT JOIN tb_customers c ON c.cusid = o.cid
LEFT JOIN tb_products p ON p.pid = od.pid
No comments: