- 浏览: 740 次
- 性别:
最新评论
文章列表
--创建建库bankDB
CREATE DATABASE bankDB
ON
(
NAME='bankDB_data',
FILENAME='d:\project\bankDB_data.mdf',
SIZE=3mb,
FILEGROWTH=15%
)
LOG ON
(
NAME= 'bankDB_log',
FILENAME='d:\project\bankDB_log.ldf',
SIZE=3mb,
FILEGROWTH=15%
)
GO
/*$$$$$$$$$$$$$建表$$$$$$$$$$$$$$$$$$$$$$$$*/
USE bankDB ...
T-SQL子查询
子查询在WHERE语句中的语法
SELECT …… FROM 表1 WHERE 列1>(子查询)
SELECT StudentNo,StudentName,Sex,Borndate,Address
FROM Student
WHERE Born>
(SELECT Borndate FROM Student WHERE StudentName='李斯文')
子查询可以替换表连接
SELECT StudentName
FROM Student
WHERE StudentNo=(
SELECT StudentNo FROM Result
IN ...