Home > Backend Development > PHP Tutorial > 关于数据库外键和主键查询的有关问题

关于数据库外键和主键查询的有关问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 10:14:20
Original
736 people have browsed it

关于数据库外键和主键查询的问题
刚学数据库没多久,请教各位大神:
A表有ID和姓名,B表有ID和分数,B表的ID是A表的外键,如何通过查找A表的姓名就能得到分数!

------解决方案--------------------
select B.fenshu from A join B ON A.id=B.id where A.name='张三';

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
AngularJS Select default value?
From 1970-01-01 08:00:00
0
0
0
Select option using PHP loop
From 1970-01-01 08:00:00
0
0
0
Chrome doesn't apply padding to select options
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template