dresende / node-sql-query

NodeJS SQL query builder
122 stars 103 forks source link

having in select clause #20

Open rumkin opened 11 years ago

rumkin commented 11 years ago

Having in select clause appends before WHERE clause that cause an synax error. And it inserts column name only, but it could be an expression too.

kcphysics commented 10 years ago

Can you give an example or some more clarification?

Are you talking about an "in" clause in a where clause like below?

SELECT * FROM table WHERE table_column in (1,2,3,4,5,6);
rumkin commented 10 years ago

I mean HEAVING keyword. Look at lines 237 and 343 in lib/Select.js. You just escape it as sql ID and then just insert into query. But heaving syntax has more options.