zoukankan      html  css  js  c++  java
  • sql 获取表字段名称

    有时候需要些插入语句需要写字段名称,但由于字段很多所有比较麻烦。用以下的语句就可以直接把所有字段名称查出来直接用了

    select GROUP_CONCAT(COLUMN_NAME) from information_schema.COLUMNS where table_name = 'activity_info';  

    合并不同数据库中相同的表:表id 增加100(这个数字根据表自身的大小来增加)

    insert into saas_award_pool_redniu_integration.activity
    (Id,ActivityName,CreationTime,CreatorUserId,DeleterUserId,DeletionTime,Description,EndDateTime,HostCompany,IsActivated,IsDeleted,IsGeoRequired,IsVaild,LastModificationTime,LastModifierUserId,PublicAccountId,RuleDescription
    ,ServicePhoneNumber,StartDateTime,TenantId,Url)
    select
    Id+100,ActivityName,CreationTime,CreatorUserId,DeleterUserId,DeletionTime,Description,EndDateTime,HostCompany,IsActivated,IsDeleted,IsGeoRequired,IsVaild,LastModificationTime,LastModifierUserId,PublicAccountId,RuleDescription
    ,ServicePhoneNumber,StartDateTime,TenantId,Url
    from saas_award_pool_redniu.activity

    得之坦然,失之淡然,争其必然,顺其自然
  • 相关阅读:
    maven mirrorOf
    使用nexus 搭建本地 maven 服务器
    django 访问静态资源
    django 异常问题总结
    django导入 views.py
    vue js 实现 树形菜单
    vue.js 基础
    css之margin
    Vue项目笔记
    eslint ":"号
  • 原文地址:https://www.cnblogs.com/leegj/p/11551274.html
Copyright © 2011-2022 走看看