anchor.diff:   ;
   
    
  -
  -
   sql_stmt_list : ';'* sql_stmt ( ';'+ sql_stmt )* ';'* ;
   
   sql_stmt : ( select_stmt) ;
  
positive.code: order_by
  	: K_ORDER K_BY op=(K_SUMRANK|K_BESTRANK) '(' + ')'			#orderBySpecial
  	| K_ORDER K_BY ordering_term ( ',' ordering_term )*	 		#orderByDefault
  	 
   
  
  
  ;
  
  select_or_values
   : K_SELECT (top_keyword)? ( K_DISTINCT | K_ALL )? result_column ( ',' result_column )*
     ( K_FROM ( table_or_subquery ( ',' table_or_subquery )* | join_clause ) )?
     ( K_WHERE expr )?
     ( K_SKYLINE K_OF exprSkyline )?
     ( K_GROUP K_BY expr ( ',' expr )* ( K_HAVING expr )? )?
   | K_VALUES '(' expr ( ',' expr )* ')' ( ',' '(' expr ( ',' expr )* ')' )*
   ;
  
  type_name : name+ ( '(' signed_number ')' | '(' signed_number ',' signed_number ')' )?
  
negative.code: column_term : ( ( database_name '.' )? table_name '.' )? column_name;
  ordering_term : expr ( K_ASC | K_DESC )? ;
  
  select_List_Item  : '*' | table_name '.' '*'  | expr ( K_AS? column_alias )?;
  
  table_List_Item
   : ( database_name '.' )? table_name ( K_AS? table_alias )?
   | '(' ( table_List_Item ( ',' table_List_Item )*
         | join_clause )
     ')' ( K_AS? table_alias )?
   | '(' select_stmt ')' ( K_AS? table_alias )?
   ;
  
  join_clause : table_List_Item ( join_operator table_List_Item join_constraint )* ;
  
  join_operator: ',' | ( K_LEFT K_OUTER? | K_INNER | K_CROSS )? K_JOIN;
  
  