1。查看连接到db的当前用户
db2 values user
2。declare global temporary table与create global temporary的区别是,
前者表结构在连接在当前session有效,后者表结构将保存到数据库中,可在多个会话中使用
共同特点
数据在会话关闭后都回丢失,都位于session schema
3。数据库元数据schema
1)sysibm元数据表
2)syscat,sysibm的视图
3)sysstat, 统计数据
4。Identity列, 数字,自动生成,唯一,
按是否允许手动指定值分成generated by default 和generated always
5。创建sequence
db2 create sequence myseq
start with 10
increment by 1
使用序列
下一个值nextval for myseq
当前值prevval for myseq
db2 select next for myseq from sysibm.dummy1
db2 insert into t(id) values(nextval for myseq)
db2 values prevval
6。视图创建
db2 create view myview as select * from t
7。创建索引
db2 create unique index myidx on t(col)
不能在视图,无权限(select除外)的表上创建索引
8。创建别名(同义词)
公共别名
db2 create public synonym mysyn for table myschema.t
私有别名
db2 create synonym mysyn for table myschema.t
别名指向的对象必须加上shema限制
待续
分享到:
相关推荐
Jim Liang Get started with machine learning 学习笔记 (311页到520页) Jim Liang Get started with machine learning 学习笔记 (311页到520页)
DB2数据库SQL注入手册1
Jim Liang machine learning notes 上半部分 Jim Liang machine learning notes 上半部分
db2 get db cfg for <db_name> 连接数据库:db2 connect to <db_name> db2 connect to <db_name> user[user_name] using [password] 断开数据库连接:db2 connect reset/db2 terminate 创建数据库:db2 create db ...
db2 administration getting started
官方S32K144的DS软件的超详细教程; 配合官方的DEMO板进行学习。 其中涉及:IO配置、时钟配置、CAN、ADC等多个实操教程。 文档供163页。
Get started with Dart (Ebook)
Get started with Raspberry Pi Zero and put all of its exciting features to use Create fun games and programs with little or no programming experience Learn to use this super-tiny PC to control ...
Get Started with MicroPython on Raspberry Pi Pico.pdf
藏经阁-5 Ways to Get Started with Rei.pdf
Getting Started with MATLAB, which introduces you to MATLAB. It covers all the primary MATLAB features at a high level, including plenty of examples to help you to learn the material quickly.
一个Eclipse用户如何开始intellij idea之旅 How to Get Started with IntelliJ IDEA as an Eclipse User
华为系交换机Press ENTER to get started卡住的原因及解决办法 华为系交换机(s2700S和S5720S亲测可用),虽然资源分有点高,确实是本人花费很多时间才总结出来的,WIN10及以下的操作系统应该都有效,但是能解决大...
Our experts help you quickly get your SOA project on the right track. Backed by years of proven software deployment experience, IBM Software Services is a team of highly skilled consultants with broad...
as the title suggests, it will get you started. It’s for teenagers, hobbyists, grandparents, and everyone in between. This book is also appropriate for people with programming experience who want to...
【MATLAB】Getting Started with MATLAB.7z
Getting Started with Keil uVision for ARM CORTEX-M
查看死锁: db2 get snapshot for locks on Linux系统怎么用命令重启db2数据库全文共4页,当前为第3页。 Linux系统怎么用命令重启db2数据库全文共4页,当前为第3页。 db2 "select agent_id,tabna
梁劲机器学习笔记-全面简单Getting Started With MachineLearning (all in one)_部分2。详细、明了地介绍了机器学习中的相关概念、数学知识和各种经典算法。以浅显易懂的方式去讲解它,降低大家的学习门槛。因为文件...
This book is for anyone who wants to learn more about databases in general and wants to get started with MariaDB. Prior database experience is not required. In Detail MariaDB is a database that has ...