我现在有两个表格,它们分别如下:
points
表格如下:
id country points
1 4 1
2 7 5
3 8 4
sample
表如下所示:
id iso pts
1 UK 100
2 US 300
3 AU 700
4 BO 1200
5 BA 1500
6 BR 2000
7 HR 5000
8 TD 10000
9 CA 15000
我所需要的是从
points
表中选取与sample.iso
和sample.pts
对应的points.country
和points.points
的所有数据。
因此,我想要实现的结果是:
id country points
1 BO 100
2 HR 1500
3 TD 1200
这是否真的可以实现?如果是,怎么做呢?
country
和points
字段是指向sample
表的外键。 - LingerBO, 100
,但在你的表中,BO
与points = 1
和pts = 1200
相关联。请记住,在未来的问题中提供逻辑数据集会更容易获得建设性的答案。 - FreeAsInBeer