table1 と table2 の 2 つのテーブルがあります。どちらのテーブルにも複数の列があります。
table1: serialno , recordno....
table2: recodno,issueid....
の条件でtable1
から
issueid
すべての行を取得したいtable2
table1.recordno=table2.recordno
recordno
fromtable1
は主キーです。MS-Access データベースを使用しています。
table1 と table2 の 2 つのテーブルがあります。どちらのテーブルにも複数の列があります。
table1: serialno , recordno....
table2: recodno,issueid....
の条件でtable1
から
issueid
すべての行を取得したいtable2
table1.recordno=table2.recordno
recordno
fromtable1
は主キーです。MS-Access データベースを使用しています。
次の結合のいずれかを使用できます。
JOIN: 両方のテーブルに少なくとも 1 つの一致がある場合に行を返します。
LEFT JOIN: 右側のテーブルに一致するものがなくても、左側のテーブルからすべての行を返します。
RIGHT JOIN: 左側のテーブルに一致するものがなくても、右側のテーブルからすべての行を返します。
FULL JOIN: テーブルの 1 つに一致する行が返されます
あなたの場合:
SELECT table1.serialno,table1.recordno, table2.issueid
FROM table1
INNER JOIN table2
ON table1.recordno=table2.recordno
ORDER BY table1.serialno
SELECT table1.serialno,table1.recordno,table2.issueid
FROM table1 LEFT OUTER JOIN table2
ON table1.recordno=table2.recordno