LNotes-SqlServer&Oracle-数据库查询语句对比

ylbtech-LearningNotes:LNotes-SqlServer&Oracle-数据库查询语句对比
 
1.A,学习课程-知识点

 SqlServer&Oracle-数据库查询语句对比。

1.B,课堂笔记及课下总结
数据库查询语句
数据库 Sql Server Oracle
基本语句    
select

select * from titles

select title_id,title,price,pub_id from titles

select * from title where title_id=9834

select * from title order by price

select * from authirs order by a_lname,a_fname

select type,count(title_id)as 每种类型数量 from title group by type

注意:where 在前 order by 其次 group by 最后

同左←
delete delete into title where title_id=9874 同左←
update update title set title=title1,price=price1 where title_id=9874 同左←
insert

insert titles(,,,,) values(,,,,)

insert titles(title,price) values('thanks to java',23.5)

同左←
     
建视图 create view view_name
as
    sql语句
 
     
建存储过程    
  create procdure proc_name
as
    sql语句
 
有参数(只有入参) create proc ups_shj
@pub_id varchar(20)
as
select * from titles where pub_id=@pub_id;
 
有参数(入参,出参output)

create proc ups_shj1
@title varchar(200),
@ytd_sales int output
as
select @ytd_sales=ytd_sales from titles where title=@title;

--执行存储过程,查找书籍'Sushi, Anyone?'
go
declare @sales int
exec ups_shj1 'Sushi, Anyone?',@ytd_sales=@sales output
select @sales

 
     
1.C,升华提升|领悟|感知|天马行空-痴人说梦

 无。

warn 作者:ylbtech
出处:http://ylbtech.cnblogs.com/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
posted on 2013-02-25 10:41  ylbtech  阅读(182)  评论(0)    收藏  举报