SML# Document

Chapter 21. SQL Expressions and Commands

sql ::= select SQL式(SQL92のSQLコマンドのサブセット)
  (distinct)?
  selectlist
  (intoClause)?
  (fromClause)?
  (whereClause)?
  (orderByClause)?
distinct ::= all
 | distinct
selectlist ::= sqlExpAsList
 | sqlExpList
sqlExpAsList ::= sqlExp as label (, sqlExpAsList)?
sqlExpList ::= sqlExp (, sqlExpList)?
intoClause ::= into id
fromClause ::= from sqlExpAsList as clause is mandatory
whereClause ::= where sqlExp
orderByClause ::= order by orderbyList
orderbyList ::= sqlExp (sqlorder)? (, orderbyList)?
sqlorder ::= ASC | DESC
sqlExp ::= appexp_noSQL ML expressions inside of SQL expressions
 | appexp andalso appexp
 | appexp orelse appexp
appexp_noSQL ::= atexp_noSQL ML expressions inside of SQL expressions
 | appexp_noSQL andalso appexp_noSQL
 | appexp_noSQL orelse appexp_noSQL
atexp_noSQL ::= atexp (excluding SQL keywords) ML expressions inside of SQL expressions(note 1)
 | #id.id

Note.

  1. In atexp, alphaId in vidstdId,and tycon do not contain SQL keywords.