Skip to content

can we just extract the where condition? #567

Closed Answered by tobymao
Opperessor asked this question in Q&A
Discussion options

You must be logged in to vote
from sqlglot import parse_one, exp

sql = "SELECT a.id, b.first_name, b.last_name FROM table1 a, table2 b where a.id = b.id;"

parse_one(sql).find(exp.Where).this.sql()

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tobymao
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants