내가 다음 쿼리가 : 쿼리가 실행 된 경우 그러나쿼리 도움말 Where 절
mysql_select_db($database_conndb1, $conndb1);
$query_rsName = sprintf("
SELECT DISTINCT
table1.search_id, table1.search1, table1.search2, table1.search3, table1.search4, table1.search5, table1.search6, table1.search7, table1.search8, table1.search9, table1.search10, table1.search11, table1.search12, table1.search13, table1.search14, table1.search15, table1.search16, table2.search_id
FROM table1, table2
WHERE
table2.criteria1 = %s OR
table2.criteria2 = %s OR
table2.criteria3 = %s OR
table2.criteria4 = %s OR
table2.criteria5 = %s OR
table2.criteria6 = %s OR
table2.criteria7 = %s OR
FIND_IN_SET(%s, table2.criteria8) OR
table2.criteria9 = %s OR
table2.criteria10 = %s OR
table2.criteria11 = %s AND
table1.search_id = table2.search_id
ORDER BY
table1.search2 DESC",
GetSQLValueString($search1_rsName, "text"),
GetSQLValueString($search2_rsName, "text"),
GetSQLValueString($search3_rsName, "text"),
GetSQLValueString($search4_rsName, "text"),
GetSQLValueString($search5_rsName, "text"),
GetSQLValueString($search6_rsName, "text"),
GetSQLValueString($search7_rsName, "text"),
GetSQLValueString($search8_rsName, "text"),
GetSQLValueString($search9_rsName, "text"),
GetSQLValueString($search10_rsName, "text"),
GetSQLValueString($search11_rsName, "text"));
을, 모든 기록을 끌어와 각 레코드에 10 번 않습니다 - 검색 기준에 따라뿐만 아니라 사람을 . 이제 OR을 AND로 변경하고 모두 11을 선택하면 정상적으로 작동합니다. 따라서 OR 피연산자와 관련이 있습니다. 그러나 나는 무엇이 잘못되었는지 알 수 없다. 검색 자에게 1, 2, 3 또는 그 이상의 기준을 선택할 수 있도록 OR 대신 어떤 피연산자를 사용할 수 있습니까?
코드/쿼리를 형식화하십시오. 그리고 여우 제발 제목 (설명하기)하십시오. – PeeHaa
X가 결합 테이블의 행 수만큼 반환 한 동일한 레코드를보고있는 경우 데카르트 조인이 있습니다. – Trent