sql语句
select *from student
select student_id from student
select student_id ,student_name from student
select student_id student_name from student 将student_name 作为student_id的别名处理
如: select student_id a from student
select a=student_id from student
从student表中分别检索出学生的学号、姓名信息并分别加上“学生”、“学号”的标题信息。
select 学号=student_id,学生=student_name from student
大部分查询都不是针对表中所有行的查询,而是从整个表中选出符合条件的信息,要实现这样的查询就要用到
从student_course表中检索成绩小于60分的学生信息。
select grade from student_course where grade<60
select * from student_course order by student_id
select top 50 percent *from student_course order by student_id 输出总行数的一半
select top 10 *from student_course order by student_id 输出前10行
‘2007-11-18’ convert cast
date'2007-11-18'
student_course表中检索成绩介于60至80分之间的学生信息。
select student_id,grade from student_course where grade between 60 and 80
从student_course表中检索学号为‘g9940202’,‘g9940204’,‘g9940206’的学生信息。
select *from student_course where (student_id='g9940202')or(student_id='g9940204')or(student_id='g9940206')
select *from student_course
select distinct student_id from student_course
select *from student_course where (student_id='g9940202')or(student_id='g9940204')or(student_id='g9940206') order by student_id
从student表中分别检索出姓张的所有同学的资料;名字的第二个字是“红”或“虹”的所有同学的资料
select *from student
select *from student where student_name like '张%'and student_name like '%红'or student_name like '%虹'
select *from student where student_name like '_[红,虹]%'
SELECT * from student WHERE student_name LIKE '_[红,虹]%'
SELECT * from student WHERE student_name LIKE '_[^红,虹]%'
SELECT * from&nbs
相关文档:
32
位的操作系统只能用
4G
的内存(不确定这句话是否正确),因为
2
的
32
次方是
4G
。默认的情况下,操作系统给自己留了
2G
,剩下的
2G
给应用程序。所以,每个应用程序所能使用的内存,最大不超过
2G
。据说可以改
WINDOWS
的
BOOT.INI
,强制操作系统只使用
1G
,即使这样,应用程序也至多是
......
Suppose we have a recursive hierarchy stored in a relational database and we want to write it to XML. This might be for a variety of reasons – e.g. as a pre-cached input to a UI control, to export to another system using a pre-defined format, etc.
In SQL Server 2000, in order to ......
SQL Server 得到行号的SQL
使用临时表:
select id=identity(int,1,1),value into #temp from YourTable
select * from #temp
drop table #temp
取得第11到20行记录:
select IDENTITY(in ......
下列语句部分是Mssql语句,不可以在access中使用。
SQL分类:
DDL—数据定义语言(CREATE,ALTER,DROP,DECLARE)
DML—数据操纵语言(SELECT,DELETE,UPDATE,INSERT)
DCL—数据控制语言(GRANT,REVOKE,COMMIT,ROLLBACK)
首先,简要介绍基础语句:
1、说明:创建数据库
CREATE DATABASE database-nam ......
Last login: Mon Feb 8 14:13:19 2010 from 192.168.1.249
ipnet
-bash-3.00$
-bash-3.00$ ipnet
-bash: ipnet: command not found
-bash-3.00$ su - oracle
Password:
eastcsu: incorrect password
-bash-3.00$ eastcom
-bash: eastcom: command not found
-bash-3.00$ su - oracle
Password:
[oracl ......