怎么处理多条件查询,怎么跟想象的结果不一样
select qid from random_t where qid like '____01____01__%' and ra_score=0 or random=1new_id qid yasf ra_score r_time random
201103 2011010102020177 2011-7-29 19:32:38
201103 2011010102020180 0 2011-7-29 19:32:38 1
201103 2011010102020181 2011-7-29 19:32:38 1
201103 2011010602030117 0 2011-7-29 19:32:44
201103 2011010602030125 0 2011-7-29 19:32:44
201103 2011010602030126 0 2011-7-29 19:32:44
201103 2011010102020172 0 2011-7-29 19:33:56
201103 2011010102020174 0 2011-7-29 19:33:56
201103 2011010102020176 0 2011-7-29 19:33:56
201103 2011010602030115 0 2011-7-29 19:34:04
201103 2011010602030117 0 2011-7-29 19:34:05
201103 2011010602030118 0 2011-7-29 19:34:05
201103 2011010602010119 0 2011-8-14 11:15:46
结果应该是“2011010602010119”,但是出来的是qid
2011010102020180
2011010102020181。怎么写条件,谢谢了,我快没有分了,吝啬点
select qid from random_t where qid like '____01____01__%' and ra_score=0 or random=1new_id qid yasf ra_score r_time random
201103 2011010102020177 2011-7-29 19:32:38
201103 2011010102020180 0 2011-7-29 19:32:38 1
201103 2011010102020181 2011-7-29 19:32:38 1
201103 2011010602030117 0 2011-7-29 19:32:44
201103 2011010602030125 0 2011-7-29 19:32:44
201103 2011010602030126 0 2011-7-29 19:32:44
201103 2011010102020172 0 2011-7-29 19:33:56
201103 2011010102020174 0 2011-7-29 19:33:56
201103 2011010102020176 0 2011-7-29 19:33:56
201103 2011010602030115 0 2011-7-29 19:34:04
201103 2011010602030117 0 2011-7-29 19:34:05
201103 2011010602030118 0 2011-7-29 19:34:05
201103 2011010602010119 0 2011-8-14 11:15:46
结果应该是“2011010602010119”,但是出来的是qid
2011010102020180
2011010102020181。怎么写条件,谢谢了,我快没有分了,吝啬点
--虽然没用过access,不过你这个明显通配符写错数目了,下面的试试
select qid from random_t where qid like '____01__01____%' and ra_score=0 or random=1
--顺带问一句,你直接where qid='2011010602010119'不好么?在看书测试?