Laravel where between


DB::table(‘table_name’)->whereBetween(‘column_name’,[value1,value2])->get(); is used for where Between condition in laravel.


Laravel where Between clause Example

We are going to fetch data with whereBetween clause in laravel from the table emp.

DB::table('emp')->whereBetween('salary',[10000,20000])->get();

Will Generate the following query.

//Select * from emp where salary BETWEEN 10000 AND 20000 ;


Advertisements

Add Comment

📖 Read More