mithrandie / csvq

SQL-like query language for csv
https://mithrandie.github.io/csvq
MIT License
1.5k stars 65 forks source link

like in combination with or doesn't work #1

Closed gaznu closed 6 years ago

gaznu commented 6 years ago

In a simple table like this (filename m100a):

+----+----------+----------+----------+---------+------------+
| Nr | Name     | Eintritt | Guthaben | Bezahlt | Kontostand |
+----+----------+----------+----------+---------+------------+
| 1  | Müller   | 2005     | Ja       | Ja      | 1200       |
| 2  | Meier    | 2004     | Nein     | Ja      | 800        |
| 3  | Hansen   | 2005     | Ja       | Nein    | 123.45     |
| 4  | Lee      | 2004     | Nein     | Nein    | -40.05     |
| 5  | Kubert   | 2003     | Ja       | Ja      | 21.85      |
| 6  | Linder   | 2005     | Nein     | Nein    | 81852      |
| 7  | Hubertus | 2005     | Ja       | Ja      | 1200       |
+----+----------+----------+----------+---------+------------+

I do

csvq "select * from m100a where Guthaben like ('N%') "
+----+--------+----------+----------+---------+------------+
| Nr | Name   | Eintritt | Guthaben | Bezahlt | Kontostand |
+----+--------+----------+----------+---------+------------+
| 2  | Meier  | 2004     | Nein     | Ja      | 800        |
| 4  | Lee    | 2004     | Nein     | Nein    | -40.05     |
| 6  | Linder | 2005     | Nein     | Nein    | 81852      |
+----+--------+----------+----------+---------+------------+

which works, however if I add the same condition (or another) with an 'or' condition, then it does not:

csvq "select * from m100a where Guthaben like ('N%') or Guthaben like ('N%')"
Empty RecordSet
mithrandie commented 6 years ago

OK, I confirmed to replicate this bug. Please wait to fix.

mithrandie commented 6 years ago

This bug has been fixed and the fix is included in the version 1.0.2. Thank you for reporting.

gaznu commented 6 years ago

Thank you for the quick fix, works for me