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
答案 0 :(得分:0)
尝试这种方式可以帮助你
$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'") );