查询SQL drupal数据库中附加到实体的字段

时间:2017-07-26 11:56:02

标签: sql drupal relational-database

用户 Screenshot users table

field_data_field_user_first_name screenshot fields table

我应该使用什么查询来获取这样的表:

Uid  Email         First name

1    123@123.com   example 

我试过没有运气:

SELECT * FROM users
LEFT JOIN field_data_field_user_first_name 
ON users.uid = ield_data_field_user_first_name.entity_id

1 个答案:

答案 0 :(得分:0)

使用此查询

,您将获得与上述相同的结果
SELECT users.uid as Uid,users.mail as Email,field_data_field_user_first_name.field_user_first_name_value as FirstName  FROM users
LEFT JOIN field_data_field_user_first_name 
ON users.uid = ield_data_field_user_first_name.entity_id;