﻿<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Gavin&#039;s Blog &#187; SQL代码</title>
	<atom:link href="http://laigw.name/tag/sql%e4%bb%a3%e7%a0%81/feed" rel="self" type="application/rss+xml" />
	<link>http://laigw.name</link>
	<description>Keep it simple, stupid. Simplicity is beauty.</description>
	<lastBuildDate>Sun, 29 Jan 2012 07:14:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>一些精彩的SQL代码</title>
		<link>http://laigw.name/post/44.html</link>
		<comments>http://laigw.name/post/44.html#comments</comments>
		<pubDate>Sat, 15 Nov 2008 03:13:15 +0000</pubDate>
		<dc:creator>Gavin</dc:creator>
				<category><![CDATA[DB/SQL]]></category>
		<category><![CDATA[SQL代码]]></category>

		<guid isPermaLink="false">http://www.laigw.name/?p=44</guid>
		<description><![CDATA[作为一名programmer，积累代码是很重要的。下面是我从网上搜集得到的一些精彩的SQL代码，可以作为平常编写SQL代码时做参考之用。

－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－

说明：复制表(只复制结构,源表名：a 新表名：b) 
select * into b from a where 1&#60;&#62;1
说明：拷贝表(拷贝数据,源表名：a 目标表名：b)
insert into b(a, b, c) select d,e,f from b;
说明：显示文章、提交人和最后回复时间
select a.title,a.username,b.adddate from table a,(select max(adddate) adddate from table where table.title=a.title) b
说明：外连接查询(表名1：a 表名2：b)
select a.a, a.b, a.c, b.c, b.d, b.f from a LEFT OUT JOIN b ON a.a = b.c
说明：日程安排提前五分钟提醒
select * from 日程安排 where datediff(&#8216;minute&#8217;,f开始时间,getdate())&#62;5
说明：两张关联表，删除主表中已经在副表中没有的信息
delete from info where [...]]]></description>
		<wfw:commentRss>http://laigw.name/post/44.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

