SELECT name, email, users.password
FROM users
INNER JOIN(
SELECT password
FROM users
GROUP BY password
HAVING COUNT(password) >1
)temp ON users.password= temp.password
where email = 'Excep@yesbus.com';
转换这个 laravel 查询版本,我尝试了这种方法,但看到找不到错误基础视图
User::select('user_id, name, type, email, username, password')
->join('temp', 'users.password', '=', 'temp.password')
->groupBy('password')
->having('password', '>',1)
->where('email', Input::get('username'))
->get();
tried this does not work can anyone please suggest how we can do this thanks in advance
尝试这种方式可能会对您有所帮助
$email = Input::get('username');
$users = DB::select( DB::raw("SELECT name, email, username, users.password FROM users INNER JOIN( SELECT password FROM users GROUP BY password HAVING COUNT(password) >1 )temp ON users.password= temp.password where email = '$email'") );