• 视图中利用唯一值列生成自动编号


     Create   Table   T(stcd   varchar(10),name   varchar(10))  
      insert   into   T   select   's001','A'  
      union   all   select   's002','B'  
      union   all   select   's003','C'  
      union   all   select   's004','D'  
      --建视图  
      Create   View   VIEW_T  
      as  
      select * from   T  
      --查询  
      select   autoid=(select   sum(1)   from   VIEW_T   where   stcd<=A.stcd),*  
      from   VIEW_T   A  
      --结果  
      序号                     stcd               name                
      -----------   ----------   ----------    
      1                       s001               A  
      2                       s002               B  
      3                       s003               C  
      4                       s004               D

    Drop   Table   T  
    Drop   View   VIEW_T 

  • 相关阅读:
    python 装饰器
    python 环境迁移之requirements.txt (window环境)
    selenium 元素查找与属性
    pytest+allure(allure-pytest基于这个插件)设计定制化报告
    Capability配置
    python_excel
    python_连接mysql
    MySql_1
    appium_环境搭建
    appium_appium简介
  • 原文地址:https://www.cnblogs.com/yasin/p/1542549.html
Copyright © 2020-2023  润新知