先看要解析的样例SQL语句: 代码如下: select * from dual SELECT * frOm dual Select C1,c2 From tb select c1,c2 from tb select count(*) from t1 select c1,c2,c3 from t1 where condi1=1 Select c1,c2,c3 From t1 Where condi1=1 select c1,c2,c3 from t1,t2 where condi3=3 or c
sqlparser-用于查询csv文件
用法
package main
import (
"fmt"
"log"
"github.com/marianogappa/sqlparser"
)
func main() {
query, err := sqlparser.Parse("SELECT a, b, c FROM 'd' WHERE e = '1' AND f > '2'")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%