Chris Dodd
Chris Dodd

Reputation: 1

JSL select Query with keyword and parantheses

I am trying to select specific values from a column in JSL, but there is an issue. The column name is:

Sum(ow_blah) 

And I would like to: select where(Sum(ow_blah) == 0)

Unfortunately, the combination of the keyword Sum and parentheses have led to significant problems. And Aliasing is not allowed in select statements. How can I use the Sum function within a where clause?

Upvotes: 0

Views: 635

Answers (2)

Syamanthaka
Syamanthaka

Reputation: 1337

Since "sum" is a keyword, you need to explicitly let JMP know that you are selecting a column by the name Sum(ow_blah). So for that, use it as:

Column("Sum(Ow_blah)")

Upvotes: 0

The Impaler
The Impaler

Reputation: 48850

Use HAVING after grouping, as in:

select id, sum(ow_blah)
  from my_table
  group by id
  having sum(ow_blah) = 0

Upvotes: 0

Related Questions