sql-to-builder icon indicating copy to clipboard operation
sql-to-builder copied to clipboard

Column comparation in where clause

Open xStarman opened this issue 7 years ago • 0 comments

SQL = select * from t1 join t2 on (t1.column1 = t2.column1) where t1.column2 = t2.column2

EXPECTED = DB::table('t1')->join('t2', 't1.column1', '=','t2.column1' )->whereRaw('t1.column2 = t2.column2')

RESULT = DB::table('t1')->where('t2.column2', '=', '')->get()

PHP Notice: Undefined index: value in E:\dev\laravel_test\sql-to-builder-master\src\Converter\WhereConverter.php on line 52

*This is a simplified version of a large query that I tried to convert

xStarman avatar Mar 06 '19 13:03 xStarman