crud icon indicating copy to clipboard operation
crud copied to clipboard

Left join entity relation with on condition

Open vadim080617 opened this issue 4 years ago • 4 comments

Is there any way to configure CRUD or CrudRequest for executing query like: select * from table1 left join "someRelation" on table1.id = "someRelation".table1ID AND "someRelation"."field1" = 99 Data in query is dumb, just for example. Maybe there is some workarounds to solve this.

vadim080617 avatar Dec 18 '20 14:12 vadim080617

I need this too, also referred here #98

0x7061 avatar Nov 11 '21 17:11 0x7061

Also need this.

For example, the deletedAt AND is automatically added, because I use the softDelete: true option, but I need additional conditions.

LEFT JOIN `locations` `location` ON `location`.`messageId` = `messages`.`id` AND (`location`.`deletedAt` IS NULL)

What I need, additional conditions:

LEFT JOIN `locations` `location` ON `location`.`messageId` = `messages`.`id` AND (`location`.`deletedAt` IS NULL) AND (`location`.`userId` = 1337)

CockpitConnect avatar Jan 19 '22 15:01 CockpitConnect

Bump

0x7061 avatar Mar 14 '22 18:03 0x7061