 例5-3
 --（1） 用as 关键字
SELECT  bookName as 书名,Author as 作者,publishDate as 出版日期,
CategoryID as 类别,price as 价格
FROM bookInfo
 --（2） 用空格
SELECT  bookName  书名,Author  作者,publishDate  出版日期,
CategoryID  类别,price  价格
FROM bookInfo
-- （3）用=号
SELECT  书名= bookName,作者= Author, 出版日期=publishDate,
类别=CategoryID  , 价格=price  
FROM bookInfo

例5-4
SELECT bookName,author,publishDate,price 
FROM BookInfo 
WHERE PublishDate>'2007-01-01'

例5-5
USE BookShopDb
GO
SELECT UserName ,SUBSTRING(UserName,1,1) as Initial ,
LEN(UserName) Lenth, Addr  FROM UserInfo
WHERE LEN(UserName)=3

例5-6
SELECT publisherName,CHARINDEX('出版社',publisherName) as pos,
SUBSTRING(publisherName,1,CHARINDEX('出版社',publisherName)-1) as pName FROM Publisher 

例5-7
 SELECT bookName,Author,PATINDEX('%数据库%',bookName) POS
FROM BookInfo 
WHERE PATINDEX('%数据库%',bookName)>0

例5-8
SELECT  GETDATE() AS '今天',DATEADD(DAY,1,GETDATE()) AS '明天'

例5-9
SELECT  BookName 书名,publishdate 出版日期, YEAR(publishDate) 年份
FROM BookInfo  
