Home  >  Article  >  Database  >  mysql-Mysql 条件查询时记录的唯一id,有多个id并且已知的,该怎么查询

mysql-Mysql 条件查询时记录的唯一id,有多个id并且已知的,该怎么查询

WBOY
WBOYOriginal
2016-06-06 09:37:34961browse

mysqlselectsql

已知id的值,比如
int pId[100];

CString sql;
sql.Format("select * from table_name where id!=%d and id!=%d and id!=%d .....",pId[0],pId[1],pId[2],.....);
难道是这样写吗?

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