小编Cry*_*aph的帖子

MySQL错误数据获取与类似查询

我正在尝试从此user_id = 1查询中获取数据,但是user_id传入数据中有不同的值。

select * 
from user_contacts uc 
inner join contacts_email_addresses ce on uc.id=ce.contact_id 
inner join contacts_phone_numbers cp on uc.id=cp.contact_id 
where uc.user_id=1 
   and cp.user_id=1 
   and ce.user_id=1 
   and uc.contact_name like '%test%' 
   or uc.contact_surname like '%test%' 
   or ce.email_address like '%test%' 
   or cp.phone_number like '%test%'
Run Code Online (Sandbox Code Playgroud)

mysql

0
推荐指数
1
解决办法
40
查看次数

标签 统计

mysql ×1