DEV Community

Discussion on: How to write this SQL select the best way?

Collapse
 
tobiassn profile image
Tobias SN

Not really an answer, but if you don’t wanna deal with SQL you could try using an ORM.

Collapse
 
dmfay profile image
Dian Fay

O/RMs don't help with this kind of situation. They operate at the level of discrete records and translate them to&from objects and object graphs. Here, it's what's in the records that matters, and specifically the relationships of multiple records in the same table. It can't be abstracted to the O/RM level; SQL is the only option.