已知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],.....);
难道是这样写吗?
已知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],.....);
难道是这样写吗?
用not in试试,这么写;
select * from table_name where id not in (1,2,3,4,5,...)