mysql-求助MySQL的关于sql语句怎么写??三表的查询~~~请大神进来帮忙~~~~~

WBOY
Release: 2016-06-02 11:27:50
Original
1081 people have browsed it

mysqlphpsql

现在我有三个表:
表1:
pre_common_member_profile:
uid(用户的uid),
gender(性别),
birthyear(出生的年),
birthmonth(出生的月),
birthday(出生的日)
表2:
pre_home_friend:
uid(用户的uid),
fuid(加为好友的uid)
表3:
pre_home_friend_request:
fuid(发送好友请求的人),
uid(发送给谁)

要求:
查找表1,但是排除一定条件。

查询表1上面的五个字段,条件为uid=570并且uid不能等于(这两个条件:1、表2中uid=570的fuid的值。2、表3中的fuid=570的uid值。)

请尽量写出的语句效率高一点。

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!