How to effectively write long queries?

79 views
Skip to first unread message

Mathieu Cassagnes

unread,
Jul 11, 2015, 11:56:40 PM7/11/15
to node-...@googlegroups.com
Is there a preferred method for writing long queries?
So far I've been writing long queries with string concatenations, like this:

"select a.*, b.name, c.title "
"from tableA a, tableB b, table C c " + 
"where a.id = b.id " + 
"and a.id = c.id " + 
"limit 1"

Writing 20+ lines queries gets tedious, is there a better way to do this?
Thanks,
Math
Message has been deleted

00a5

unread,
Jun 16, 2017, 9:46:29 PM6/16/17
to node-mysql
I've written my own query builder. I would suggest making one so there's no code duplication and it'll make the code easier to understand and edit
Reply all
Reply to author
Forward
0 new messages