mysql> CREATE TABLE user
id INT NOT NULL AUTO_INCREMENT KEY,
name CHAR(20));
mysql> CREATE TABEL sayur
(id INT NOT NULL AUTO_INCREMENT KEY,
name CHAR(10));
mysql> CREATE TABLE connect
(id INT NOT NULL AUTO_INCREMENT KEY,
uid INT,
sid INT);
The you use left outer join to select the related data
mysql> SELECT name.user, name.sayur FROM user, sayur, connect
WHERE user.id = normal.uid AND sayur.id = normal.sid;
No comments:
Post a Comment