$first = DB::table('users')
->select("id","full_name")
**->addSelect("user_table AS tableN")**
->where("full_name", "LIKE", "%a%");
$users = DB::table("medical_specialties")
->select("id","name")
**->addSelect("medical_speciality_table As tableN")**
->where("NAME", "LIKE", "%a%")
->union($first)
->toSql();
这是laravel Eloquent查询,其中addSelect方法应该在结果集“Type”中创建新列,其中将包含一些文本即表名但它会给出此错误