Home  >  Article  >  Database  >  复合语句查询-mysql 数据库 多表 复合 查询

复合语句查询-mysql 数据库 多表 复合 查询

WBOY
WBOYOriginal
2016-06-06 09:40:111648browse

复合语句查询mysql查询数据库

一共有3个表,
goods表,有3个字段: id (int,PK) , price (float), name (varchar(20))
buyer表,有2个字段: id(int,PK) ,name (varchar(20))
buyRecord表,有3个字段:id(int PK), buyerId(int,FK) , goodsId(int,FK)
问题:
如何用一句或多句语句查询出buyer表中id为0的用户的消费总金额?

Statement:
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