dinedal / textql

Execute SQL against structured text like CSV or TSV
MIT License
9.05k stars 300 forks source link

Neither CONCAT nor || are working for concatenating #140

Open whalekeykeeper opened 1 year ago

whalekeykeeper commented 1 year ago

My goal is to concatenate two strings, such as first_name and family_name. I tried with:select concat(first_name, ' ', family_name) as name from survey, the result is no such function: CONCAT. Then I tried to use || as: select first_name || ' ' || family_name as name from survey, I got zsh: permission denied. I considered the case that it might be the textql command I used was wrong. I used:

textql -output-header -output-file csv/data/survey_fullname.csv -header -sql
"select CONCAT(first_name, ' ', family_name) as name from survey"
csv/data/survey.csv

I also tried the version to have ; at the end of the SQL statements. But if I replaced the content of the sql statement, everything goes well. I wonder if textql support concatenation of strings?