简体   繁体   English

mysql select *从哪里获得服装行

[英]mysql select * Where and get costume row from one field

I have Table with name person.sql 我有名称为person.sql的表

======================================
id      name            address

1       jhon            CA
2       alex            FL
3       adam            NY
4       max             SF
5       robert          AL
6       mat             AK
7       emet            CO
8       frank           HI
9       ian             IL
10      fredy           KS
===================================

my problem is can't get costume row using where id if i want only get id like 1 2 5 8 10 how to implemented ? 我的问题是,如果我只想像1 2 5 8 10这样的ID来获取服装行,而我却无法实现?

im using this query but return empty 即时通讯使用此查询,但返回空

SELECT * from tbl person where id='1' AND id='2' AND id='5' AND id='8' AND id='10'

please help for this :( 请为此:(

您需要搜索ID在您的集合中的位置,因此:SELECT * FROM表WHERE ID IN(1、3、5、8)

SELECT * from tbl person where id='1' OR id='2' OR id='5' OR id='8' OR id='10'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM