pixie icon indicating copy to clipboard operation
pixie copied to clipboard

SubQueries in where() not working properly

Open drozdza opened this issue 9 years ago • 1 comments

I would like to do something like this:

$query = QB::table('my_table2')->select('id')
         ->where('table_id', QB::subQuery($subQuery)))

It produces good working code with rawSql() but don't work itself.

To fix this problem I need to do workaround like this:

$query = QB::table('my_table2')->select('id')
          ->where(QB::raw('table_id = ' . QB::subQuery($subQuery)))

drozdza avatar Apr 26 '16 14:04 drozdza

I wanted to but I couldn't reproduce your case. I checked and in my opinion it works.

Could you give us all query?

[Pixie v2.0, Mysql]

mrcnpdlk avatar Nov 15 '16 20:11 mrcnpdlk