mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-09-05 21:50:36 +00:00
Support SELECT DISTINCT
This commit is contained in:
parent
31b6076d05
commit
bbf1805729
3 changed files with 17 additions and 1 deletions
|
@ -1352,6 +1352,7 @@ impl Parser {
|
|||
/// Parse a restricted `SELECT` statement (no CTEs / `UNION` / `ORDER BY`),
|
||||
/// assuming the initial `SELECT` was already consumed
|
||||
pub fn parse_select(&mut self) -> Result<SQLSelect, ParserError> {
|
||||
let distinct = self.parse_keyword("DISTINCT");
|
||||
let projection = self.parse_select_list()?;
|
||||
|
||||
let (relation, joins) = if self.parse_keyword("FROM") {
|
||||
|
@ -1381,6 +1382,7 @@ impl Parser {
|
|||
};
|
||||
|
||||
Ok(SQLSelect {
|
||||
distinct,
|
||||
projection,
|
||||
selection,
|
||||
relation,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue