SQLStringMatchQ[col,patt]
specifies a condition in an SQL query used to test whether the value of a column matches a pattern. The actual format for the pattern varies from one database to another.
更多信息和选项
范例
基本范例
参见
技术笔记
相关指南
DatabaseLink`
DatabaseLink`
SQLStringMatchQ
SQLStringMatchQ[col,patt]
specifies a condition in an SQL query used to test whether the value of a column matches a pattern. The actual format for the pattern varies from one database to another.
更多信息和选项
- To use SQLStringMatchQ, you first need to load DatabaseLink using Needs["DatabaseLink`"].
范例
基本范例 (1)
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 DatabaseLink`DatabaseExamples` package, as described in Using the Example Databases.
conn = OpenSQLConnection["publisher"];Select data matching a pattern:
SQLSelect[conn, "ROYSCHED", {"TITLE_ID", "ROYALTY"}, SQLStringMatchQ[SQLColumn["TITLE_ID"], "C%"]]SQLSelect[conn, "ROYSCHED", {"TITLE_ID", "ROYALTY"}, SQLStringMatchQ[SQLColumn["TITLE_ID"], "_S%"]]CloseSQLConnection[conn];