not correct result Two conditions for one field in

2019-03-04 07:49发布

my Query: any result with this query

SELECT
  ref,
  COUNT(*)
FROM
  transaction
WHERE (`type` = 10
    OR `type` = 11)
  AND player = 1195
GROUP BY transaction.`ref`
HAVING COUNT(*) > 2;

if on WHERE i change on filed type: i have row with type 10 and 11

WHERE `type` = 10

WHERE `type` = 11

i see result.

  player  reference    type  
  1195      10046         9
  1195      10082         9
  1195      18786        11
  1195      18786        11
  1195      18791        10
  1195      18795        10
  1195      18814        11
  1195      18814        11
  1195      18814        11
  1195      18823        10
  1195      18823        10
  1195      18823        10

why?

标签: mysql mysqli
0条回答
登录 后发表回答