You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get Uncaught TypeError: Cannot read property 'toString' of undefined when I'm trying to use BETWEEN in a CASE. Other operators such as > and < still work but would be too verbose for range determination.
varcities=[{City: "Moscow",Population: 1},{City: "London",Population: 10},{City: "Paris",Population: 100}];alasql.promise('SELECT * FROM ?',[cities]).then(function(city){// This worksprint(alasql('SELECT City, CASE WHEN Population > 1 AND Population < 100 THEN "yes" ELSE "no" END AS isBetween1and100 FROM ?',[city]));// This doesn't workprint(alasql('SELECT City, CASE WHEN Population BETWEEN 1 AND 100 THEN "yes" ELSE "no" END AS isBetween1and100 FROM ?',[city]));}).catch(function(reason){print(reason['message']);}).then(function(){print('AlaSQL v'+alasql.version)});functionprint(x){document.getElementById('output').textContent+=JSON.stringify(x,null,'\t')+'\n';}
Activity
mathiasrw commentedon Aug 16, 2016
Thanks for a perfect bugreport
mathiasrw commentedon Nov 19, 2025
Context:
becomes
Support BETWEEN operator in CASE statement to fix #735 (#2195)