<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head profile="http://internetalchemy.org/2003/02/profile"> <link rel="foaf" type="application/rdf+xml" title="FOAF" href="http://www.openlinksw.com/dataspace/uda/about.rdf" /> <link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" /> <meta name="dc.subject" content="SQL" /> <meta name="dc.subject" content="SQL Reference" /> <meta name="dc.subject" content="Select" /> <meta name="dc.subject" content="Update" /> <meta name="dc.subject" content="delete" /> <meta name="dc.subject" content="Select Statement" /> <meta name="dc.subject" content="SQL Syntax" /> <meta name="dc.subject" content="Syntax" /> <meta name="dc.title" content="8. SQL Reference" /> <meta name="dc.subject" content="8. SQL Reference" /> <meta name="dc.creator" content="OpenLink Software Documentation Team ; " /> <meta name="dc.copyright" content="OpenLink Software, 1999 - 2009" /> <link rel="top" href="index.html" title="OpenLink Virtuoso Universal Server: Documentation" /> <link rel="search" href="/doc/adv_search.vspx" title="Search OpenLink Virtuoso Universal Server: Documentation" /> <link rel="parent" href="sqlreference.html" title="Chapter Contents" /> <link rel="prev" href="accessinterfaces.html" title="Data Access Interfaces" /> <link rel="next" href="sqlrefDATATYPES.html" title="Datatypes" /> <link rel="shortcut icon" href="../images/misc/favicon.ico" type="image/x-icon" /> <link rel="stylesheet" type="text/css" href="doc.css" /> <link rel="stylesheet" type="text/css" href="/doc/translation.css" /> <title>8. SQL Reference</title> <meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8" /> <meta name="author" content="OpenLink Software Documentation Team ; " /> <meta name="copyright" content="OpenLink Software, 1999 - 2009" /> <meta name="keywords" content="SQL; SQL Reference; Select; Update; delete; Select Statement; SQL Syntax; Syntax; " /> <meta name="GENERATOR" content="OpenLink XSLT Team" /> </head> <body> <div id="header"> <a name="sqlreference" /> <img src="../images/misc/logo.jpg" alt="" /> <h1>8. SQL Reference</h1> </div> <div id="navbartop"> <div> <a class="link" href="sqlreference.html">Chapter Contents</a> | <a class="link" href="dataccessclientsconfailandbalance.html" title="Virtuoso Data Access Clients Connection Fail over and Load Balancing Support">Prev</a> | <a class="link" href="sqlrefDATATYPES.html" title="Datatypes">Next</a> </div> </div> <div id="currenttoc"> <form method="post" action="/doc/adv_search.vspx"> <div class="search">Keyword Search: <br /> <input type="text" name="q" /> <input type="submit" name="go" value="Go" /> </div> </form> <div> <a href="http://www.openlinksw.com/">www.openlinksw.com</a> </div> <div> <a href="http://docs.openlinksw.com/">docs.openlinksw.com</a> </div> <br /> <div> <a href="index.html">Book Home</a> </div> <br /> <div> <a href="contents.html">Contents</a> </div> <div> <a href="preface.html">Preface</a> </div> <br /> <div> <a href="overview.html">Overview</a> </div> <div> <a href="installation.html">Installation Guide</a> </div> <div> <a href="quicktours.html">Quick Start & Tours</a> </div> <div> <a href="sampleapps.html">Sample ODBC & JDBC Applications</a> </div> <div> <a href="concepts.html">Conceptual Overview</a> </div> <div> <a href="server.html">Administration</a> </div> <div> <a href="accessinterfaces.html">Data Access Interfaces</a> </div> <div class="selected"> <a href="sqlreference.html">SQL Reference</a> <div> <a href="sqlrefDATATYPES.html" title="Datatypes">Datatypes</a> </div> <div> <a href="udt.html" title="User Defined Types">User Defined Types</a> </div> <div> <a href="sqlrefxmldatatype.html" title="XML Column Type">XML Column Type</a> </div> <div> <a href="catidentifiers.html" title="Identifier Case & Quoting">Identifier Case & Quoting</a> </div> <div> <a href="wideidentifiers.html" title="Wide Character Identifiers">Wide Character Identifiers</a> </div> <div> <a href="QUALIFIEDNAMES.html" title="Qualified Names">Qualified Names</a> </div> <div> <a href="litsbraceescs.html" title="Literals, Brace Escapes">Literals, Brace Escapes</a> </div> <div> <a href="CREATETABLE.html" title="CREATE TABLE Statement">CREATE TABLE Statement</a> </div> <div> <a href="DROPTABLE.html" title="DROP TABLE Statement">DROP TABLE Statement</a> </div> <div> <a href="CREATEINDEX.html" title="CREATE INDEX Statement">CREATE INDEX Statement</a> </div> <div> <a href="DROPINDEX.html" title="DROP INDEX Statement">DROP INDEX Statement</a> </div> <div> <a href="ALTERTABLE.html" title="ALTER TABLE Statement">ALTER TABLE Statement</a> </div> <div> <a href="CREATEVIEW.html" title="CREATE VIEW Statement">CREATE VIEW Statement</a> </div> <div> <a href="CREATEXMLSCHEMA.html" title="CREATE XML SCHEMA Statement">CREATE XML SCHEMA Statement</a> </div> <div> <a href="DROPXMLSCHEMA.html" title="DROP XML SCHEMA Statement">DROP XML SCHEMA Statement</a> </div> <div> <a href="sequenceobjects.html" title="Sequence Objects">Sequence Objects</a> </div> <div> <a href="insertSTMT.html" title="INSERT Statement">INSERT Statement</a> </div> <div> <a href="updatestmt.html" title="UPDATE Statement">UPDATE Statement</a> </div> <div> <a href="SELECTSTMT.html" title="SELECT Statement">SELECT Statement</a> </div> <div> <a href="COMMIT_ROLLBACK.html" title="COMMIT WORK, ROLLBACK WORK Statement">COMMIT WORK, ROLLBACK WORK Statement</a> </div> <div> <a href="CHECKPOINT.html" title="CHECKPOINT, SHUTDOWN Statement">CHECKPOINT, SHUTDOWN Statement</a> </div> <div> <a href="spasviewsandtables.html" title="Stored Procedures as Views & Derived Tables">Stored Procedures as Views & Derived Tables</a> </div> <div> <a href="GRANT.html" title="GRANT, REVOKE Statement">GRANT, REVOKE Statement</a> </div> <div> <a href="SETstmt.html" title="SET Statement">SET Statement</a> </div> <div> <a href="anytimequeries.html" title="Anytime Queries">Anytime Queries</a> </div> <div> <a href="besteffortunion.html" title="Best Effort Union">Best Effort Union</a> </div> <div> <a href="aggregates.html" title="Standard and User-Defined Aggregate Functions">Standard and User-Defined Aggregate Functions</a> </div> <div> <a href="sqloptimizer.html" title="Virtuoso SQL Optimization">Virtuoso SQL Optimization</a> </div> <div> <a href="sqlinverse.html" title="SQL Inverse Functions">SQL Inverse Functions</a> </div> <div> <a href="GRAMMAR.html" title="SQL Grammar">SQL Grammar</a> </div> <div> <a href="BITMAPINDICES.html" title="Bitmap Indices">Bitmap Indices</a> </div> <div> <a href="transitivityinsQL.html" title="Transitivity in SQL">Transitivity in SQL</a> </div> <div> <a href="sqlreffastphrasematch.html" title="Fast Phrase Match Processor">Fast Phrase Match Processor</a> </div> </div> <div> <a href="sqlprocedures.html">SQL Procedure Language Guide</a> </div> <div> <a href="hooks.html">Database Event Hooks</a> </div> <div> <a href="repl.html">Data Replication, Synchronization and Transformation Services</a> </div> <div> <a href="webappdevelopment.html">Web Application Development</a> </div> <div> <a href="webandxml.html">XML Support</a> </div> <div> <a href="rdfandsparql.html">RDF Data Access and Data Management</a> </div> <div> <a href="webservices.html">Web Services</a> </div> <div> <a href="runtimehosting.html">Runtime Hosting</a> </div> <div> <a href="internetservices.html">Internet Services</a> </div> <div> <a href="freetext.html">Free Text Search</a> </div> <div> <a href="tpcc.html">TPC C Benchmark Kit</a> </div> <div> <a href="xa.html">Using Virtuoso with Tuxedo</a> </div> <div> <a href="appendixa.html">Appendix</a> </div> <div> <a href="functions.html">Virtuoso Functions Guide</a> </div> <br /> </div> <div id="text"> <div class="abstract"> <h2>Abstract</h2> <p>SQL Reference.</p> </div> <h2>Table of Contents</h2> <div class="minitoc"> <div> <a class="sect1" href="sqlrefDATATYPES.html">8.1. Datatypes</a> </div> <div> <a class="sect2" href="sqlrefDATATYPES.html#dt_dateliterals">8.1.1. Date Literals</a> </div> <div> <a class="sect2" href="sqlrefDATATYPES.html#dtcasting">8.1.2. Casting</a> </div> <div> <a class="sect2" href="sqlrefDATATYPES.html#sqldatemanus">8.1.3. Time & Date Manipulation</a> </div> <div> <a class="sect2" href="sqlrefDATATYPES.html#deccolexp">8.1.4. Declaring Collations of Expressions</a> </div> <div> <a class="sect1" href="udt.html">8.2. User Defined Types</a> </div> <div> <a class="sect2" href="udt.html#udtcreatetypestmt">8.2.1. CREATE TYPE Statement</a> </div> <div> <a class="sect2" href="udt.html#udtaltertypestmt">8.2.2. ALTER TYPE Statement</a> </div> <div> <a class="sect2" href="udt.html#udtdroptypestmt">8.2.3. DROP TYPE Statement</a> </div> <div> <a class="sect2" href="udt.html#udtcreatemethodstmt">8.2.4. CREATE METHOD Statement</a> </div> <div> <a class="sect2" href="udt.html#udttypeinstances">8.2.5. Type Instances</a> </div> <div> <a class="sect2" href="udt.html#udtinstancerefs">8.2.6. Instance References</a> </div> <div> <a class="sect2" href="udt.html#udtnewop">8.2.7. NEW Operator</a> </div> <div> <a class="sect2" href="udt.html#udtfindingmethods">8.2.8. Finding Methods - Method Signatures Generation & Comparison</a> </div> <div> <a class="sect2" href="udt.html#udtgetsetmembervals">8.2.9. Getting & Setting Member Values of Type Instances (member observers & mutators)</a> </div> <div> <a class="sect2" href="udt.html#udtstaticmethods">8.2.10. Calling Static Methods</a> </div> <div> <a class="sect2" href="udt.html#udtcallinstmethod">8.2.11. Calling Instance Methods</a> </div> <div> <a class="sect2" href="udt.html#udtserilizingtypeinst">8.2.12. Serializing & Deserializing Type Instances</a> </div> <div> <a class="sect2" href="udt.html#udtutilfuncs">8.2.13. User Defined Types Utility Functions</a> </div> <div> <a class="sect2" href="udt.html#udthostedforiegnobjects">8.2.14. Hosted Foreign Objects in Virtuoso</a> </div> <div> <a class="sect2" href="udt.html#udtrepressentsoapstruct">8.2.15. Using User Defined Types to Represent SOAP Structures</a> </div> <div> <a class="sect2" href="udt.html#udtcnsmsoap">8.2.16. Consuming Third-Party SOAP Services via User Defined Types</a> </div> <div> <a class="sect2" href="udt.html#udtsecurity">8.2.17. UDT Security</a> </div> <div> <a class="sect1" href="sqlrefxmldatatype.html">8.3. XML Column Type</a> </div> <div> <a class="sect1" href="catidentifiers.html">8.4. Identifier Case & Quoting</a> </div> <div> <a class="sect1" href="wideidentifiers.html">8.5. Wide Character Identifiers</a> </div> <div> <a class="sect2" href="wideidentifiers.html#utf8notes4odbc">8.5.1. UTF-8 Implementation Notes For ODBC</a> </div> <div> <a class="sect2" href="wideidentifiers.html#utf8notes4jdbc">8.5.2. UTF-8 Implementation Notes In JDBC</a> </div> <div> <a class="sect1" href="QUALIFIEDNAMES.html">8.6. Qualified Names</a> </div> <div> <a class="sect2" href="QUALIFIEDNAMES.html#qual_owners">8.6.1. Qualifiers and Owners</a> </div> <div> <a class="sect2" href="QUALIFIEDNAMES.html#defaultqualifiers">8.6.2. Default Qualifiers</a> </div> <div> <a class="sect2" href="QUALIFIEDNAMES.html#userstmtid">8.6.3. USE Statement, USE identifier</a> </div> <div> <a class="sect1" href="litsbraceescs.html">8.7. Literals, Brace Escapes</a> </div> <div> <a class="sect2" href="litsbraceescs.html#strings">8.7.1. Strings</a> </div> <div> <a class="sect2" href="litsbraceescs.html#numbers">8.7.2. Numbers</a> </div> <div> <a class="sect2" href="litsbraceescs.html#odbcbraceesc">8.7.3. ODBC Brace Escapes</a> </div> <div> <a class="sect2" href="litsbraceescs.html#sqlrefhexliterals">8.7.4. Hexadecimal Literals</a> </div> <div> <a class="sect2" href="litsbraceescs.html#sqlrefbinliterals">8.7.5. Binary Literals</a> </div> <div> <a class="sect1" href="CREATETABLE.html">8.8. CREATE TABLE Statement</a> </div> <div> <a class="sect2" href="CREATETABLE.html#syntax">8.8.1. Syntax</a> </div> <div> <a class="sect2" href="CREATETABLE.html#consnotnull">8.8.2. NOT NULL</a> </div> <div> <a class="sect2" href="CREATETABLE.html#identity">8.8.3. IDENTITY (Auto Increment)</a> </div> <div> <a class="sect2" href="CREATETABLE.html#default">8.8.4. DEFAULT</a> </div> <div> <a class="sect2" href="CREATETABLE.html#pkeycons">8.8.5. PRIMARY KEY Constraint</a> </div> <div> <a class="sect2" href="CREATETABLE.html#under">8.8.6. UNDER</a> </div> <div> <a class="sect2" href="CREATETABLE.html#fkeys">8.8.7. FOREIGN KEY Constraint</a> </div> <div> <a class="sect2" href="CREATETABLE.html#sqlrefcreattablecheck">8.8.8. The CHECK Constraint</a> </div> <div> <a class="sect2" href="CREATETABLE.html#sqlrefcreattablewithschema">8.8.9. The WITH SCHEMA Constraint</a> </div> <div> <a class="sect1" href="DROPTABLE.html">8.9. DROP TABLE Statement</a> </div> <div> <a class="sect1" href="CREATEINDEX.html">8.10. CREATE INDEX Statement</a> </div> <div> <a class="sect1" href="DROPINDEX.html">8.11. DROP INDEX Statement</a> </div> <div> <a class="sect1" href="ALTERTABLE.html">8.12. ALTER TABLE Statement</a> </div> <div> <a class="sect2" href="ALTERTABLE.html#sqlrefalttabcheck">8.12.1. Adding a CHECK Constraint</a> </div> <div> <a class="sect1" href="CREATEVIEW.html">8.13. CREATE VIEW Statement</a> </div> <div> <a class="sect1" href="CREATEXMLSCHEMA.html">8.14. CREATE XML SCHEMA Statement</a> </div> <div> <a class="sect1" href="DROPXMLSCHEMA.html">8.15. DROP XML SCHEMA Statement</a> </div> <div> <a class="sect1" href="sequenceobjects.html">8.16. Sequence Objects</a> </div> <div> <a class="sect1" href="insertSTMT.html">8.17. INSERT Statement</a> </div> <div> <a class="sect2" href="insertSTMT.html#insertsoft">8.17.1. INSERT SOFT</a> </div> <div> <a class="sect2" href="insertSTMT.html#insertreplacing">8.17.2. INSERT REPLACING</a> </div> <div> <a class="sect1" href="updatestmt.html">8.18. UPDATE Statement</a> </div> <div> <a class="sect1" href="SELECTSTMT.html">8.19. SELECT Statement</a> </div> <div> <a class="sect2" href="SELECTSTMT.html#selectsyntax">8.19.1. Syntax</a> </div> <div> <a class="sect2" href="SELECTSTMT.html#descrip">8.19.2. Description</a> </div> <div> <a class="sect2" href="SELECTSTMT.html#ASDEC">8.19.3. Column Aliasing - AS Declaration</a> </div> <div> <a class="sect2" href="SELECTSTMT.html#joinexamples">8.19.4. Join examples</a> </div> <div> <a class="sect2" href="SELECTSTMT.html#ordergrping">8.19.5. Ordering and Grouping</a> </div> <div> <a class="sect2" href="SELECTSTMT.html#derivedtables">8.19.6. Derived Tables</a> </div> <div> <a class="sect2" href="SELECTSTMT.html#qryexpressions">8.19.7. Query Expressions</a> </div> <div> <a class="sect2" href="SELECTSTMT.html#LikePredicate">8.19.8. LIKE Predicate & Search Patterns</a> </div> <div> <a class="sect2" href="SELECTSTMT.html#topselectoption">8.19.9. The TOP SELECT Option</a> </div> <div> <a class="sect2" href="SELECTSTMT.html#caseandco">8.19.10. CASE, NULLIF, COALESCE, CAST Value Expressions</a> </div> <div> <a class="sect2" href="SELECTSTMT.html#selbreackup">8.19.11. SELECT BREAKUP</a> </div> <div> <a class="sect1" href="COMMIT_ROLLBACK.html">8.20. COMMIT WORK, ROLLBACK WORK Statement</a> </div> <div> <a class="sect1" href="CHECKPOINT.html">8.21. CHECKPOINT, SHUTDOWN Statement</a> </div> <div> <a class="sect2" href="CHECKPOINT.html#checkpointparams">8.21.1. Checkpoint & Page Remapping</a> </div> <div> <a class="sect1" href="spasviewsandtables.html">8.22. Stored Procedures as Views & Derived Tables</a> </div> <div> <a class="sect2" href="spasviewsandtables.html#proctabparams">8.22.1. Procedure Table Parameters</a> </div> <div> <a class="sect2" href="spasviewsandtables.html#proctabressets">8.22.2. Procedure Table Result Sets</a> </div> <div> <a class="sect2" href="spasviewsandtables.html#proctabsecurity">8.22.3. Procedure Tables & Security</a> </div> <div> <a class="sect2" href="spasviewsandtables.html#proctabcost">8.22.4. Procedure Table Cost and Join Order</a> </div> <div> <a class="sect2" href="spasviewsandtables.html#proctablimits">8.22.5. Limitations</a> </div> <div> <a class="sect2" href="spasviewsandtables.html#procexamples">8.22.6. Procedure Table Examples</a> </div> <div> <a class="sect1" href="GRANT.html">8.23. GRANT, REVOKE Statement</a> </div> <div> <a class="sect1" href="SETstmt.html">8.24. SET Statement</a> </div> <div> <a class="sect2" href="SETstmt.html#isolation">8.24.1. ISOLATION</a> </div> <div> <a class="sect2" href="SETstmt.html#lockescalation">8.24.2. LOCK_ESCALATION_PCT</a> </div> <div> <a class="sect2" href="SETstmt.html#transactiontimeout">8.24.3. transaction_timeout</a> </div> <div> <a class="sect2" href="SETstmt.html#parambatch">8.24.4. PARAM_BATCH</a> </div> <div> <a class="sect1" href="anytimequeries.html">8.25. Anytime Queries</a> </div> <div> <a class="sect1" href="besteffortunion.html">8.26. Best Effort Union</a> </div> <div> <a class="sect1" href="aggregates.html">8.27. Standard and User-Defined Aggregate Functions</a> </div> <div> <a class="sect2" href="aggregates.html#aggcreateaggrstmt1">8.27.1. Create Aggregate Statement</a> </div> <div> <a class="sect2" href="aggregates.html#aggdropaggrstmt">8.27.2. Drop Aggregate Statement</a> </div> <div> <a class="sect2" href="aggregates.html#createaggrsam">8.27.3. Examples of User-Defined Aggregates</a> </div> <div> <a class="sect1" href="sqloptimizer.html">8.28. Virtuoso SQL Optimization</a> </div> <div> <a class="sect2" href="sqloptimizer.html#opttechniques">8.28.1. Optimization Techniques</a> </div> <div> <a class="sect2" href="sqloptimizer.html#queryoptions">8.28.2. Query Options</a> </div> <div> <a class="sect2" href="sqloptimizer.html#opttechanyorder">8.28.3. ANY ORDER</a> </div> <div> <a class="sect2" href="sqloptimizer.html#vdbcoststats">8.28.4. VDB Statistics for the SQL Compiler Collection</a> </div> <div> <a class="sect1" href="sqlinverse.html">8.29. SQL Inverse Functions</a> </div> <div> <a class="sect2" href="sqlinverse.html#updthoughinverses">8.29.1. Updating through Inverses</a> </div> <div> <a class="sect1" href="GRAMMAR.html">8.30. SQL Grammar</a> </div> <div> <a class="sect1" href="BITMAPINDICES.html">8.31. Bitmap Indices</a> </div> <div> <a class="sect2" href="BITMAPINDICES.html#bitmapindandtrans">8.31.1. Bitmap Indices and Transactions</a> </div> <div> <a class="sect2" href="BITMAPINDICES.html#bitmapindandperfmimpl">8.31.2. Performance Implications</a> </div> <div> <a class="sect2" href="BITMAPINDICES.html#physicalstroverheads">8.31.3. Physical Structure and Overheads</a> </div> <div> <a class="sect1" href="transitivityinsQL.html">8.32. Transitivity in SQL</a> </div> <div> <a class="sect1" href="sqlreffastphrasematch.html">8.33. Fast Phrase Match Processor</a> </div> <div> <a class="sect2" href="sqlreffastphrasematch.html#sqlreffastphrasematchscl">8.33.1. Phrases, Phrase Sets and Phrase Classes</a> </div> <div> <a class="sect2" href="sqlreffastphrasematch.html#sqlreffastphrasematchapi">8.33.2. Phrase Set Configuration API</a> </div> <div> <a class="sect2" href="sqlreffastphrasematch.html#sqlreffastphrasematchsadv">8.33.3. Advertisers and Advertisement Rules</a> </div> <div> <a class="sect2" href="sqlreffastphrasematch.html#sqlreffastphraseexample">8.33.4. Example</a> </div> </div> <br /> <table border="0" width="90%" id="navbarbottom"> <tr> <td align="left" width="33%"> <a href="dataccessclientsconfailandbalance.html" title="Virtuoso Data Access Clients Connection Fail over and Load Balancing Support">Previous</a> <br />Virtuoso Data Access Clients Connection Fail over and Load Balancing Support</td> <td align="center" width="34%"> <a href="sqlreference.html">Chapter Contents</a> </td> <td align="right" width="33%"> <a href="sqlrefDATATYPES.html" title="Datatypes">Next</a> <br />Datatypes</td> </tr> </table> </div> <div id="footer"> <div>Copyright© 1999 - 2009 OpenLink Software All rights reserved.</div> <div id="validation"> <a href="http://validator.w3.org/check/referer"> <img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /> </a> <a href="http://jigsaw.w3.org/css-validator/"> <img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" height="31" width="88" /> </a> </div> </div> </body> </html>