做报表需要知道的基本的SQL语句

 时间:2024-10-12 03:18:30

1、查询数据:编摒蛲照燔号表示查询顺序。(8) select (9) distinct (11) <top_specification > <select_list>稆糨孝汶;(1)from<lef t_table>(3) <join_type> join <right_table>(2) on <join _condition>(4) where <where_condition>(5)group by <group_by_list>(6) with {cube|rollup}(7)having(having_condition)(10) order by <order_by_condition>

做报表需要知道的基本的SQL语句

2、向表中插入数据:insert into table(field) values (value)

做报表需要知道的基本的SQL语句

3、把筛选后的数据插入到一张还不存在的临时表中:select * into 目标表 from 表 where ...

做报表需要知道的基本的SQL语句

4、把筛选后的数据插入到一张已存在的临时表中:insert into 目的表 select * from 表 where 条件insert into table1 (熠硒勘唏field1 ) Select field2 from table2

做报表需要知道的基本的SQL语句

5、把A数据库的某个表的数据全部插入到B数据库的某个表中:select * into B.btable from A.atable where ...

做报表需要知道的基本的SQL语句

6、修改表的某表的某字段类型和长度:alter table tablename modify (name varchar2(20))

做报表需要知道的基本的SQL语句

7、为某表增加字段:alter table表名ADD 字段名 类型

做报表需要知道的基本的SQL语句

8、为某表修改字段名:alter table 表名 rename column A to B

做报表需要知道的基本的SQL语句

9、为某表修改数据内容:update tablename set name =’张三‘ where name =’李四‘。该命令需要执行“commit”之后才会生效。

做报表需要知道的基本的SQL语句

10、多张表更新:Update table1 set table1.field 1=table2.field2 from table1,table2 where table1.field3= table2 .filed3

做报表需要知道的基本的SQL语句

11、删除某表某条数据:delete from table where condition

做报表需要知道的基本的SQL语句
  • 兴业生活行用卡积分查询
  • 携程旅行怎么设置关联账号?
  • Outlook如何开启天气
  • 怎样按时缴纳水电等生活费用?
  • 房屋安全鉴定费用收取标准
  • 热门搜索
    国学经典手抄报图片 有关书的手抄报 我爱读书手抄报大全 有关感恩的手抄报 创建平安校园手抄报 关于热爱生命的手抄报 清明节文明祭祀手抄报 手抄报a4版面设计图 法制与安全的手抄报 爱国手抄报版面设计图