antares-sql / antares

A modern, fast and productivity driven SQL client with a focus in UX
https://antares-sql.app
MIT License
1.79k stars 122 forks source link

Numeric comparisons on strings in table data filters #825

Open bart-schaefer opened 3 months ago

bart-schaefer commented 3 months ago

In the table data view, it would be useful to be able to force filters to do a numeric comparison on a char column.

I have a table with a varchar(255) column that has several hundred thousand values that, if represented as numbers, are between 9000 and 20000000, plus a few thousand rows that are a mix of letters and numbers. I would like to filter this for rows where the numeric value of the column is less-than/greater-than something, but the filter always uses string comparisons so I get ASCII ranges instead, which is not useful.

Describe the solution you'd like One possibility would be for the comparison menu to include separate choices for string vs. numeric comparisons, but that menu is already getting rather long. Alternately this could possibly be combined with #689 so that converting the result to a numeric type would also perform the comparisons that way.

Describe alternatives you've considered Using a SQL tab and writing a query works.

Fabio286 commented 2 months ago

I think i will implement a more advanced way to filter, with options to cast, hide columns and more options to compare values.