简体   繁体   English

违反完整性约束:1052

[英]Integrity constraint violation: 1052

Integrity constraint violation: 1052 Column 'id' in where clause is ambiguous (SQL: select * from kumeti_member_registrations left join members list on members list . id = kumeti_member registrations . member_name where id = 2)",完整性约束冲突:1052列在where子句是模糊的'ID'(SQL:从SELECT * kumeti_member_registrations左加入members listmembers listid = kumeti_member registrationsmember_name其中id = 2)”,

this Query please solve the error此查询请解决错误

$result = DB::table('kumeti_member_registrations')
            ->leftjoin('members_list', 'members_list.id', '=', 'kumeti_member_registrations.member_name')
            ->where('id', $id)
            ->get();

You need to specify the table name as id is common in both tables and is therefore ambiguous您需要指定表名,因为id在两个表中都是通用的,因此不明确

So所以

->where('kumeti_member_registrations.id', $id)

Try this:尝试这个:

$result = DB::table('kumeti_member_registrations')
            ->leftjoin('members_list', 'members_list.id', '=', 'kumeti_member_registrations.member_name')
            ->where('kumeti_member_registrations.id', $id)
            ->get();

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SQLSTATE[23000]:完整性约束违规:1052 - SQLSTATE[23000]: Integrity constraint violation: 1052 SQLSTATE [23000]:违反完整性约束:1052与laravel结合使用 - SQLSTATE[23000]: Integrity constraint violation: 1052 using join with laravel 违反完整性约束:1052 order子句中的“位置”列不明确 - Integrity constraint violation: 1052 Column 'position' in order clause is ambiguous 完整性约束违规:1052 where子句中的列'id'不明确 - Integrity constraint violation: 1052 Column 'id' in where clause is ambiguous Laravel 完整性约束违规:1052 列 'id' in where 子句不明确 - Laravel Integrity constraint violation: 1052 Column 'id' in where clause is ambiguous 错误:违反完整性约束:加入 Laravel Eloquent 时出现 1052 - Error: Integrity constraint violation: 1052 when Join in Laravel Eloquent 违反完整性约束:1052 where子句不明确的列'prof_id'Laravel - Integrity constraint violation: 1052 Column 'prof_id' in where clause is ambiguous Laravel PDOException:SQLSTATE [23000]:违反完整性约束:1052 IN / ALL / ANY子查询中的列“ category_id”不明确 - PDOException: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'category_id' in IN/ALL/ANY subquery is ambiguous Laravel Eloquent:违反完整性约束:where 子句中的 1052 列“id”不明确 - Laravel Eloquent: Integrity constraint violation: 1052 Column 'id' in where clause is ambiguous 如何解决完整性约束违规:1052 列 'id' in where 子句在 laravel 中不明确 - How to solve Integrity constraint violation: 1052 Column 'id' in where clause is ambiguous in laravel
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM