csvsql 쿼리 구문 오류가 발생했습니까?

csvsql 쿼리 구문 오류가 발생했습니까?

열 값이 "PI Date"인 레코드를 attributes.csv제외하고 모든 레코드를 새 파일로 검색하려는 csv 파일이 있습니다 .attributes_withoutPIDate.csvName

csvsql이런 식으로 명령을 내리다

csvsql -d ',' -I --query 'select * where Name <> "PI Date" from attributes' attributes.csv > attributes_withoutPIDate.csv

오류 발생

(sqlite3.OperationalError) near "from": syntax error
[SQL: select * where Name <> "PI Date" from attributes]
(Background on this error at: http://sqlalche.me/e/e3q8)

문법 오류가 있는 것 같아요. 누구든지 문제를 해결하는 방법을 제안할 수 있나요?

답변1

csvsql -d ',' -I --query 'select * from attributes where Name <> "PI Date"' attributes.csv > attributes_withoutPIDate.csv

나는 그것을 알아낸 것 같아요 :-

조항 from TABLE 앞에 와야 합니다 .WHERE

이렇게 쿼리를 다시 작성하면 작동하는 것 같습니다.

관련 정보