⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 t_sql.html

📁 makefile 例子
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<title>Transact-SQL </title>
<meta name="generator" content="Namo WebEditor v3.0">
</head>

<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">

<p align="center" style="line-height:130%;"><font size="5"><b>Transact-SQL </b></font></p>
<p style="line-height:130%;"><font size="2" color="navy"><b>SQL</b></font><font
 size="2"> : ANSI ( American National Standard Institute )俊辑 瘤沥茄 RDBMS甫 
力绢窍扁 困茄 钎霖 攫绢.</font></p>
<p style="line-height:130%;"><font size="2" color="navy"><b>Transact-SQL</b></font><font
 size="2"> : ANSI SQL俊 MS SQL 辑滚父狼 眠啊利牢 扁瓷 眠啊.</font></p>
<p style="line-height:130%;"><b>SQL巩狼 辆幅</b>
<ol style="line-height:130%;">
    <li style="line-height:130%;"><font size="2">&nbsp;&nbsp;&nbsp;Data Control 
    Language(DCL) : GRANT, REVOKE, DENY</font>
    <li style="line-height:130%;"><font size="2">&nbsp;&nbsp;&nbsp;Data Definition 
    Language(DDL) : CREATE, ALTER, DROP</font>
    <li style="line-height:130%;"><font size="2">&nbsp;&nbsp;&nbsp;Data Manipulation 
    Language(DML) : SELECT, INSERT, DELETE, UPDATE</font>
</ol>
<p style="line-height:130%;">&nbsp;</p>
<p align="left" style="line-height:130%;"><font size="4"><b>I. &nbsp;SELECT 
(单捞鸥 啊廉坷扁)</b></font></p>
<ul>
    <p style="line-height:130%;"><font size="2">SELECT 巩篮 单捞磐甫 努扼捞攫飘俊霸 
    焊咯林扁 困秦 荤侩登哥 老馆利栏肺 抛捞喉俊辑 单捞磐甫 啊廉坷扁 困秦 荤侩窍绰 
    疙飞绢肺 促剧茄 炼扒阑 烹秦辑 荤侩磊啊 盔窍绰 抛捞喉狼 拿烦苞 饭内靛甫 急琶秦辑 
    阂矾棵 荐 乐促.</font></p>
</ul>
<p style="line-height:130%;"><font size="2">&nbsp;&nbsp;&nbsp; </font><font size="2"
 color="red"><b>Syntax &nbsp;&nbsp;&nbsp;</b></font><font size="2"><b>SELECT</b></font><font
 size="2"> &nbsp;select_list &nbsp;</font><font size="2"><b>FROM</b></font><font
 size="2"> &nbsp;table_name &nbsp;[ </font><font size="2"><b>WHERE</b></font><font
 size="2"> &nbsp;search_conditions ]</font></p>
<p style="line-height:130%;"><font size="2" color="red"><b>&nbsp;&nbsp;&nbsp; 
角 嚼</b></font></p>
<p style="line-height:130%;"><font size="2">&nbsp;&nbsp;&nbsp;1. publishers 
抛捞喉狼 葛电 拿烦阑 焊咯霖促.</font></p>
<p style="line-height:130%;"><font size="2" color="navy">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SELECT 
&nbsp;* &nbsp;FROM &nbsp;publishers</font></p>
<p style="line-height:130%;"><font size="2">&nbsp;&nbsp;&nbsp;2. 漂沥 抛捞喉俊辑 
急琶等 拿烦 单捞磐 啊廉坷扁 </font></p>
<p style="line-height:130%;"><font size="2" color="navy">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;USE 
&nbsp;PUBS</font></p>
<p style="line-height:130%;"><font size="2" color="navy">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SELECT 
&nbsp;pub_id, pub_name &nbsp;FROM publishers</font></p>
<p style="line-height:130%;"><font size="2">&nbsp;&nbsp;&nbsp;3. 漂沥 Row狼 
单捞磐 啊廉坷扁 (WHERE)</font></p>
<p style="line-height:130%;"><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pub_id 
蔼捞 '1000' 焊促 累篮 巴父 啊廉柯促.</font></p>
<p style="line-height:130%;"><font size="2" color="navy">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SELECT 
&nbsp;pub_id , pub_name &nbsp;FROM publishers WHERE pub_id &lt; '1000'</font></p>
<p style="line-height:130%;"><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;裹困 
楷魂磊 BETWEEN 荤侩 : pub_name捞 'F' 客 'H' 荤捞狼 蔼牢 巴父 啊廉柯促.</font></p>
<p style="line-height:130%;"><font size="2" color="navy">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SELECT 
&nbsp;pub_id , pub_name &nbsp;FROM publishers WHERE pub_name &nbsp;BETWEEN &nbsp;'F' 
and 'H'</font></p>
<p style="line-height:130%;"><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;府胶飘 
(list) 楷魂磊 &nbsp;IN : pub_id 拿烦 蔼捞 '1234', '1622', '1756' 吝狼 窍唱牢 
蔼阑 啊廉柯促.</font></p>
<p style="line-height:130%;"><font size="2" color="navy">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SELECT 
&nbsp;pub_id , pub_name &nbsp;FROM publishers WHERE pub_id &nbsp;IN &nbsp;('1234', 
'1622', '1756')</font></p>
<p style="line-height:130%;"><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;漂沥 
巩磊凯 茫扁 (LIKE) : pub_name俊 'Pub'扼绰 巩磊凯捞 甸绢乐绰 饭内靛甫 茫酒辰促.</font></p>
<p style="line-height:130%;"><font size="2" color="navy">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SELECT 
&nbsp;pub_id , pub_name &nbsp;FROM publishers WHERE pub_name &nbsp;LIKE '%Pub%'</font></p>
<p style="line-height:130%;"><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NULL 
蔼 促风扁 (ISNULL) : state 拿烦俊 绢恫 蔼捞电 甸绢乐绰 row甫 啊廉柯促.</font></p>
<p style="line-height:130%;"><font size="2" color="navy">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SELECT 
&nbsp;pub_id , pub_name &nbsp;FROM publishers WHERE state &nbsp;IS NOT NULL</font></p>
<p style="line-height:130%;"><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pub_id 
蔼捞 '1000' 焊促 农绊, country 蔼捞 'USA' 捞芭唱 city 蔼捞 B肺 矫累登绰 row甫 
啊廉柯促.</font></p>
<p style="line-height:130%;"><font size="2" color="navy">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SELECT 
&nbsp;* &nbsp;FROM publishers WHERE pub_id &gt; '1000' and country = 'USA' or 
city LIKE 'B%'</font></p>
<p style="line-height:130%;"><font size="2">&nbsp;&nbsp;&nbsp;4. 免仿鉴辑 沥窍扁 
( ORDER BY )</font></p>
<p style="line-height:130%;"><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;孽府 
搬苞肺 唱坷绰 row甫 沥纺茄促. ( ASC : 坷抚瞒鉴 / DESC : 郴覆瞒鉴 )</font></p>
<p style="line-height:130%;"><font size="2" color="navy">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SELECT 
&nbsp;pub_id , pub_name, city, state, country &nbsp;&nbsp;</font></p>
<p style="line-height:130%;"><font size="2" color="navy">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FROM 
publishers ORDER BY &nbsp;country, city &nbsp;ASC</font></p>
<p style="line-height:130%;"><font size="2">&nbsp;&nbsp;&nbsp;5. 孽府 搬苞 歹窍扁 
( UNION ) : 辑肺 炼扒捞 促弗 孽府狼 搬苞甫 钦茄促.</font></p>
<p style="line-height:130%;"><font size="2">&nbsp;</font><font size="2" color="navy">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SELECT 
&nbsp;pub_id , pub_name &nbsp;FROM publishers WHERE pub_id = '0736' </font></p>
<p style="line-height:130%;"><font size="2" color="navy">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;UNION 
</font></p>
<p style="line-height:130%;"><font size="2" color="navy">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SELECT 
&nbsp;pub_id , pub_name &nbsp;FROM publishers WHERE pub_name &nbsp;LIKE 'Binnet%'</font></p>
<p style="line-height:130%;">&nbsp;</p>
<p style="line-height:130%;"><font size="4"><b>II. INSERT</b></font><font size="2"> 
</font></p>
<ul>
    <p style="line-height:130%;"><font size="2">INSERT 巩篮 瘤沥等 抛捞喉俊 
    货肺款 饭内靛甫 眠啊窍搁辑 瘤沥等 拿烦俊 蔼阑 措涝茄促.</font></p>
</ul>
<p style="line-height:130%;"><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
 size="2" color="red"><b>Syntax </b></font><font size="2">&nbsp;&nbsp;&nbsp;</font><font
 size="2"><b>INSERT</b></font><font size="2"> &nbsp;[INTO] &nbsp;table_name 
&nbsp;[ (column_list) ] &nbsp;</font><font size="2"><b>VALUES</b></font><font
 size="2"> &nbsp;(values_list)</font></p>
<p style="line-height:130%;"><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;...... INSERT 
巩 角嚼俊 菊辑 pubs 单捞磐海捞胶俊 促澜苞 鞍捞 货肺款 抛捞喉阑 窍唱 父电促 ......</font></p>
<ul>
    <ul>
        <p style="line-height:12%;"><font size="2" color="navy">use &nbsp;PUBS</font></p>
        <p style="line-height:12%;"><font size="2" color="navy">CREATE &nbsp;TABLE 
        &nbsp;pub</font></p>
        <p style="line-height:12%;"><font size="2" color="navy">(</font></p>
        <p style="line-height:12%;"><font size="2" color="navy">&nbsp;&nbsp;&nbsp;pub_id 
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;char 
        &nbsp;(4) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;primary 
        key,</font></p>
        <p style="line-height:12%;"><font size="2" color="navy">&nbsp;&nbsp;&nbsp;pub_name 
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;varchar &nbsp;(40) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NULL,</font></p>
        <p style="line-height:12%;"><font size="2" color="navy">&nbsp;&nbsp;&nbsp;city 
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;varchar 
        &nbsp;(20) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NULL,</font></p>
        <p style="line-height:12%;"><font size="2" color="navy">&nbsp;&nbsp;&nbsp;state 
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;char 
        &nbsp;(2) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NULL,</font></p>
        <p style="line-height:12%;"><font size="2" color="navy">&nbsp;&nbsp;&nbsp;country 
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;varchar 
        &nbsp;(30) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NULL &nbsp;&nbsp;DEFAULT &nbsp;('KOR')</font></p>
        <p style="line-height:12%;"><font size="2" color="navy">)</font></p>
    </ul>
</ul>
<p style="line-height:130%;"><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
 size="2" color="red"><b>角 嚼</b></font></p>
<p style="line-height:130%;"><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;pub 抛捞喉俊 
饭内靛甫 眠啊茄促.</font></p>
<p style="line-height:130%;"><font size="2" color="navy">&nbsp;&nbsp;&nbsp;&nbsp;INSERT 
&nbsp;INTO &nbsp;pub &nbsp;( pub_id, pub_name, city, state, country ) </font></p>
<p style="line-height:130%;"><font size="2" color="navy">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VALUES 
( '9901', 'SQL BOOKS', 'SEOUL', 'AB', 'KOR' )</font></p>
<p style="line-height:130%;"><font size="2">&nbsp;&nbsp;&nbsp;火涝等 饭内靛甫 
犬牢茄促 &nbsp;: &nbsp;</font><font size="2" color="navy">SELECT &nbsp;* &nbsp;FROM 
&nbsp;pub</font></p>
<p style="line-height:130%;">&nbsp;</p>
<p style="line-height:130%;"><font size="4"><b>III. UPDATE</b></font></p>
<ul>
    <p style="line-height:130%;"><font size="2">抛捞喉俊 甸绢啊 乐绰 拿烦蔼阑 
    荐沥茄促.</font></p>
</ul>
<p style="line-height:130%;"><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
 size="2" color="red"><b>角 嚼</b></font></p>
<p style="line-height:130%;"><font size="2" color="navy">&nbsp;&nbsp;&nbsp;&nbsp;UPDATE 
&nbsp;pub &nbsp;SET &nbsp;pub_name = 'SQL BOOKS 1' &nbsp;WHERE &nbsp;pub_id 
= '9901'</font></p>
<p style="line-height:130%;"><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;荐沥等 饭内靛甫 
犬牢茄促 &nbsp;: &nbsp;</font><font size="2" color="navy">SELECT &nbsp;* &nbsp;FROM 
&nbsp;pub &nbsp;WHERE pub_id = '9901'</font></p>
<p style="line-height:130%;">&nbsp;</p>
<p style="line-height:130%;"><font size="4"><b>IV. DELETE</b></font></p>
<ul>
    <p style="line-height:130%;"><font size="2">抛捞喉俊 甸绢啊 乐绰 肺快甫 
    昏力茄促.</font></p>
</ul>
<p style="line-height:130%;"><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
 size="2" color="red"><b>角 嚼</b></font></p>
<p style="line-height:130%;"><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;pub_id = 
'9905' &nbsp;炼扒阑 父练窍绰 饭内靛甫 昏力茄促.</font></p>
<p style="line-height:130%;"><font size="2" color="navy">&nbsp;&nbsp;&nbsp;&nbsp;DELETE 
&nbsp;FROM &nbsp;pub &nbsp;WHERE &nbsp;pub_id = '9905'</font></p>
</body>

</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -