我正在尝试编写一个查询,根据用户的角色和帐单地址显示用户列表。
我收到的结果却有些数据错了。例如,我知道有些用户在英国现场直播,但美国地址正在显示。
我的查询是
`SELECT u.uid, u.name, mail, commerce_customer_address_country, commerce_customer_address_postal_code, fdcca.entity_id FROM users u
INNER JOIN users_roles ur ON ur.uid = u.uid
INNER JOIN user_address ua ON ua.uid = u.uid
INNER JOIN field_data_commerce_customer_address fdcca ON ua.address_id = fdcca.entity_id
WHERE ur.rid = 11 AND commerce_customer_address_country != 'GB'
LIMIT 50`
我认为我的连接错了,但我有点迷失了,并且会感激任何提示。
答案 0 :(得分:0)