dimanche 20 mars 2022

Use Laravel query builder inside WherenotIn

I have the following query and i want to know if this is possible in laravel's querybuilder:

SELECT "a".*
FROM   "area" AS "a"
       INNER JOIN "transaction" AS "t"
               ON "t"."f_id" = "a"."f_id"
WHERE  "t"."id" = 'c5931409-37b7-4248-b958-831edaae4075'
       AND "a"."id" NOT IN(SELECT "zc"."a_id"
                           FROM   "transaction_detail" AS td
                                  INNER JOIN "zone_component" AS "zc"
                                          ON "zc"."id" = "td"."comp_id"
                           WHERE
           td."t_id" = 'c5931409-37b7-4248-b958-831edaae4075'
           AND td."card_type" IN ( 'C_OVA', 'C_M21' ));  


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire