DatabaseLink SQL Operations >

SQLSelect

SQLSelect
extracts data from a table in an SQL connection.
SQLSelect
extracts data from particular columns.
SQLSelect
only extracts data that matches cond.
  • The following options can be given:
"Distinct"Falsewhether to return only distinct results
"GetAsStrings"Falsewhether to return the results as strings
"MaxRows"Automaticthe maximum number of rows to return
"ShowColumnHeadings"Falsewhether to return headings with the results
"SortingColumns"Nonehow to sort the data
"Timeout"Nonethe timeout for the query
If you find that the examples in this section do not work as shown, you may need to install or restore the example database with the package, as described in .
Select all data from a table:
Select only certain columns:
Join data from multiple tables:
Select data matching a condition:
Select data matching a pattern:
Select data matching a list:
If you find that the examples in this section do not work as shown, you may need to install or restore the example database with the package, as described in .
Needs["DatabaseLink`"]
If you find that the examples in this section do not work as shown, you may need to install or restore the example database with the package, as described in Using the Example Databases.
In[2]:=
Click for copyable input
Select all data from a table:
In[3]:=
Click for copyable input
Out[3]=
Select only certain columns:
In[4]:=
Click for copyable input
Out[4]=
Join data from multiple tables:
In[5]:=
Click for copyable input
Out[5]//Short=
Select data matching a condition:
In[6]:=
Click for copyable input
Out[6]=
Select data matching a pattern:
In[7]:=
Click for copyable input
Out[7]=
In[8]:=
Click for copyable input
Out[8]=
Select data matching a list:
In[9]:=
Click for copyable input
Out[9]=
In[10]:=
Click for copyable input
If you find that the examples in this section do not work as shown, you may need to install or restore the example database with the package, as described in Using the Example Databases.
Select data matching a condition:
Combine conditions using And and Or:
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team