数据库知识点

1、oracle左右连接,外连接,内连接查询区别

2、oracle、mysql自增序列、主键、表的重命名、表字段名修改、表字段类型修改、外键关联

3、oracle、mysql 触发器、函数、存储过程、

4、oracle、mysql 的分页查询

5、理解下面oracle语句

select * from (select row_.*, rownum recordnum from (select  tt.*,  ( select sum(st.now_count) from consumable_in_detail st  inner join consumable_in_list icil on st.in_id = icil.id  where st.consumable_type = tt.consumableType and  st.consumable_name = tt.consumableName and st.consumable_code = tt.consumableCode and st.brand = tt.brand and st.model = tt.model and tt.now_count>0 ) nowCount from  (select row_number() over (partition by t.consumable_code,t.consumable_name,t.brand,t.model,t.consumable_type order by t.id) rn, t.id , t.consumable_type consumableType,t.consumable_name consumableName,t.consumable_code consumableCode,t.use_way useWay,  decode(t.use_way,1,'测试',2,'办公') useWayName, decode(t.source,1,'购入',2,'退库') sourceName, eac.class_name consumableTypeName, t.source ,t.shelf_id shelfId,t.depostary_id depostaryId, spd.shelf_position_name shelfName, dl.depositary_name depositaryName,t.brand,t.model,t.fee_unit feeUnit,ul.unit_name feeUnitName,t.price_excluding_tax priceExcludingTax, t.price_including_tax priceIncludingTax,t.fa_account_id faAccountId,t.config,t.project,t.suppliers,t.suppliers_contact suppliersContact, t.maintenance_time maintenanceTime,t.maintain_fulfill_date maintainFulfillDate,t.maintain_suppliers maintainSuppliers, t.maintain_contact_person maintainContactPerson,t.maintain_tel maintainTel,t.city,t.building,t.floor,cil.in_time inDate, el.employee_name inPerson,cil.in_no inNo,t.now_count now_count from consumable_in_detail t inner join consumable_in_list cil on t.in_id = cil.id inner join SHELF_POSITION_DIC spd on spd.shelf_position_id=t.shelf_id inner join depositary_list dl on dl.depositary_id = t.depostary_id  inner join employee_list el on el.employee_id = cil.in_person  inner join Expend_Article_Class eac on eac.class_id = t.consumable_type  left join unit_list ul on ul.unit_id = t.fee_unit  and t.now_count>0) tt where tt.rn = 1  ) row_ ) where recordnum > 0 and recordnum <= 20

 ?6、union all和union

posted on 2016-07-05 17:45  独臂刀客  阅读(180)  评论(0编辑  收藏  举报

导航