hunt
DTDrizzle Team
•Created by hunt on 5/2/2024 in #help
Help building queries based on multiple conditions from an array of objects
Hello, I'm having trouble formulating a query that will match rows to multiple conditions at the same time.
Suppose I have an array of objects like :
and a Table1 with :
where param1 should match up with col1, and param2 should match with col2.
In this example, how can I query Table1 so that I only retrieve rows where (col1 == "val1" && col2 == "val2") or (col1 == "val3" && col2 == "val4") ?
If I extract all the values of param1 and param2, and use them each in an inArray, like :
I run the risk of also returning values such as
col1 == "val1"
col2 == "val4"
and
col1 == "val3"
col2 == "val2"
which were not in the original array.
Is there a way to do this?
Thank you
2 replies
DTDrizzle Team
•Created by hunt on 3/21/2024 in #help
Emulate upsert operation in mySQL
Hi guys, I'm a little new to drizzle / SQL. Is the following method a good way of generically emulating an upsert for a MySQL db? Are there any issues with this strategy?
Thanks
1 replies