Table of Contents
帮忙写条简单的sql
Jun 23, 2016 pm 01:52 PM
sql
Simple
a表 b表 c表 ,a表和b表条件关联gid ,b表和c表关联cid,我要怎么把这3个表联表呀?
条件是gid=20
数据库类型:mysql
回复讨论(解决方案)
select * from b left join(a,c) on (a.gid=b.gid and c.cid=b.cid) where b.gid=20
Copy after login
如果不想要可能出现的 NULL,则
select * from a,b,c where a.gid=b.gid and b.cid=c.cid and a,gid=20
Copy after login
你安装一个Navicat,建立一个视图,完全不需要手写了。 直接拖就行。
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

Hot Article
Repo: How To Revive Teammates
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
How Long Does It Take To Beat Split Fiction?
3 weeks ago
By DDD
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌

Hot tools Tags

Hot Article
Repo: How To Revive Teammates
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
How Long Does It Take To Beat Split Fiction?
3 weeks ago
By DDD
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The easiest way to query the hard drive serial number

What is the difference between HQL and SQL in Hibernate framework?

Usage of division operation in Oracle SQL

What does the identity attribute in SQL mean?

Comparison and differences of SQL syntax between Oracle and DB2

Detailed explanation of the Set tag function in MyBatis dynamic SQL tags

How to use SQL statements for data aggregation and statistics in MySQL?
