SQLÓï¾äPART8
PairWise subquery:
e.g.:
select * from wf_docsort where (ndocsortid,nmoduleinfoid) in (select ndocsortid, nmoduleinfoid from wf_docsort where instr(cname,'ÎÄ')>0)
the above sql is the same function as:
select * from wf_docsort where ndocsortid = (select ndocsortid from wf_docsort where instr(cname,'xx')>0) and nmoduleinfoid = (select nmoduleinfoid from wf_docsort where instr(cname,'xx')>0)
A scalar subquery expression is a subquery that: returns exactly one column value from one row. Scalar subqueries can be used in: 1) The condition and expression part of DECODE and CASE 2) All clauses of SELECT except GROUP BY 3) The SET clause and WHERE clause of an UPDATE statement
e.g.:
select * from wf_docsort
results:
1 1 ÊÕÎÄ SHOUWEN
2 1 ·¢ÎÄ FAWEN
3 1 ½»°ì JIAOBAN
4 2 Öµ°à±¨¸æ REPORT
5 3 ¶½²ì¶½°ì SUPERVISAL
6 2 Öµ°à¿ì±¨ DAILYREPORT
7 2 ÎÒµÄÊÂÇé NOTIFY
8 4 Ìá°¸ RESOLUTION
9 4 ½¨Òé SUGGESTION
select NDOCSORTID, NMODULEINFOID,CNAME,KEY,(
case when nmoduleinfoid=(
select nmoduleinfoid from wf_moduleinfo where nmoduleinfoid=1
) then 'JEAN1' else (case when nmoduleinfoid=(select nmoduleinfoid from wf_moduleinfo
&n
Ïà¹ØÎĵµ£º
SQLÓï¾äÓï·¨
Ŀ¼
13.1. Êý¾Ý¶¨ÒåÓï¾ä
13.1.1. ALTER DATABASEÓï·¨
13.1.2. ALTER TABLEÓï·¨
13.1.3. CREATE DATABASEÓï·¨
13.1.4. CREATE INDEXÓï·¨
13.1.5. CREATE TABLEÓï·¨
13.1.6. DROP DATABASEÓï·¨
13.1.7. DROP INDEXÓï·¨
13.1.8. DROP TABLEÓï·¨
13.1.9. RENAME TABLEÓï·¨
13.2. Êý¾Ý²Ù×÷Óï¾ ......
using System;
using System.Text.RegularExpressions;
using Microsoft.SqlServer.Server;
public partial class UserDefinedFunctions
{
[Microsoft.SqlServer.Server.SqlFunction(IsDeterministic = true,IsPrecise = true)]
public static bool RegExIsMatch(string pattern,string matchString)
{
......
°üÓɰü¹æ·¶ºÍ°üÌåÁ½²¿·Ö×é³É¡£
1¡¢°ü¹æ·¶£¨Package Specification£©
°ü¹æ·¶£¬Ò²½Ð×ö°üÍ·£¬°üº¬ÁËÓйذüµÄÄÚÈݵÄÐÅÏ¢¡£µ«ÊÇ£¬Ëü²»°üº¬Èκιý³ÌµÄ´úÂë¡£
´´½¨°üÍ·µÄÓï·¨Ò»°ãÈçÏÂ
CREATE [OR REPLACE] PACKAGE package_name {IS | AS}
Procedure_name | function_name | variable_declaration | type_def ......
Confirming granted privileges
Data Dictionary View Description
ROLE_SYS_PRIVS System privileges granted to roles
ROLE_TAB_PRIVS & ......