Skip to content
Advertisement

SQL CASE WHEN: is there a limit ( in number of characters )? [closed]

I’m using the case when statement to group locations ( starting & destination lat, long ) into 3 regions.

Running 1 query for each region works fine.

Just bundle all the regions in a single query, the result comes empty.

The 3 queries above work fine. The following one results empty:

Observing that the strings of coordinates are a quite long was what led me to try separating the regions.

(2 x 5,739 + 2 x 2,417 + 2 x 3,079 ) = 22,578


What I would like your thoughts on is:

  • is there a limit for the case when statement? if so, how many characters is the cap?
  • what would be a more practical solution than splitting the query into three?

Advertisement

Answer

this should works:

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement