Home >Database >Mysql Tutorial >mysql两张表关联设置里面的内容

mysql两张表关联设置里面的内容

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

mysqlsql

已经第一张表goods 主键goods_id,价格price,另一张表product 有外键goods_id,价格price。现在要求如果product中的price=0,那么设置这个price的值等于goods表中的price,求这条sql怎么写,谢谢大家

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