is it possible to write any logic like this using OR ?

SELECT p.* FROM products p JOIN categories c ON p.category_id = c.category_id WHERE c.full_path LIKE 'Electronics/Laptop/%' OR c.full_path = 'Electronics/Laptop'; is it possible to write any logic like this using OR ?
13 Replies
francis
francis11mo ago
i'm confused, this should do exactly what you want what is your question
Alvee
AlveeOP11mo ago
not row but dirzzle orm stuff
francis
francis11mo ago
Drizzle ORM - next gen TypeScript ORM
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
Alvee
AlveeOP11mo ago
umm not sure what's wrong. it works when I put withotu variable the pathname
No description
No description
Alvee
AlveeOP11mo ago
this one works without the pathurl in a variable
No description
Alvee
AlveeOP11mo ago
how can I put the Electronic/Laptop dy namicly from variable @francis
francis
francis11mo ago
why are you not using the actual query builder api
Alvee
AlveeOP11mo ago
it shows raw SQL don't have any option to use OR without raw SQL
francis
francis11mo ago
????????? read the link I said .where(or(condition1, condition2)) ?????
Alvee
AlveeOP11mo ago
saw there arleady
No description
Alvee
AlveeOP11mo ago
umm fak I missed
francis
francis11mo ago
dude that is illustrating what the generated sql is
Alvee
AlveeOP11mo ago
yea my bad @francis thanks bro. I thought not possbile cuz the ai on drizzle orm was saying rip.
Want results from more Discord servers?
Add your server