Home  >  Article  >  Backend Development  >  求 sql select如何同时查询2个值

求 sql select如何同时查询2个值

WBOY
WBOYOriginal
2016-06-13 12:36:351420browse

求 sql select怎么同时查询2个值
比如 在数据库中 一个键hide=y和hide=n 要同时实现出等于y和n的数据要怎么写
sql的语句不是很懂 我是这么写的 虽然没报错
SELECT * FROM blog WHERE type='$type' $author and hide='y' and hide='n' $condition $limit
但是却都不显示
SELECT * FROM blog WHERE type='$type' $author and hide='y' $condition $limit
这样就可以 但是这能显示等于Y的 不能实现出等于n的

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