ICode9

精准搜索请尝试: 精确搜索
  • EntityFrameworkCore 配置2022-09-15 10:05:06

    Nuget引用组件: Microsoft.EntityFrameworkCore.Design Microsoft.EntityFrameworkCore.SqlServer Microsoft.EntityFrameworkCore.Tools  连接字符串 appsetting.json "ConnectionStrings": { "DefaultConnection": "Server=DESKTOP-DABHN6U\\MSS

  • stream.sum List和json互转2022-08-29 09:04:55

    原文链接:https://blog.csdn.net/fighting_xuan/article/details/112609463 https://blog.csdn.net/weixin_49186526/article/details/116098255 //这两部分效果相同 monitorCount = tableNameList.stream().mapToDouble(tableName -> multiSourceMapper.getCountByMonitorTabl

  • MySql(二)2022-08-24 17:35:39

    MySql查询 基本数据查询 全表查询 select * from tableName; 查询部分字段 select Field from tableName; 计数1 select count(*) from tableName; 计数2 select count(1) from tableName; 条件过滤 and (并且) select * from tableName where 条件1 and 条件2; or(或

  • MySql(一)2022-08-23 19:34:48

    安装MySql 首先下载MySql,下载地址为https://dev.mysql.com/downloads/windows/installer/5.7.html MySQL安装成功后,需要配置到环境变量,配置成功后,就可以登录到MySQL了,客户端登录的命令具体为: mysql -h localhost -u root -p 数据库的管理 database:数据库 table:表 表里面存储数据

  • 【gp】取schema下表及其注释,去除分区表2022-08-20 09:33:48

    【sql】 select a.tablename as tname            b.remark      as remark from (       select table_name tablename       from information_schem.tables       where upper(table_schema)=upper('your schema') )    a inner join  (        sele

  • 【pg】查表是否存在2022-08-19 05:30:20

    【PG SQL】 一行流方式: select count(*) from information_schema.table where table_schema='your schema' and table_type='BASE TABLE' and upper(table_name)=upper('your tableName') 层次化方式: select count(*) from information_schema.table

  • 查询数据库中每张表的数据以及索引占用空间2022-08-15 23:00:09

    BEGIN   --查询目前数据库中的用户表   DECLARE @currentTable TABLE (tableName NVARCHAR(50));   INSERT INTO @currentTable (tableName)   SELECT name   FROM sys.objects   WHERE type = 'U';   --缓存系统存储过程的表变量   DECLARE @temp TABLE(tableName NVARCH

  • db2笔记_5_特殊排序2022-08-11 15:02:01

    根据fcustno分类,按ftime排序(不同的fcustno,fnum从1开始算) 取fcustno和对应的最大ftime: select * from ( SELECT FCUSTNO,FTIME,row_number() over(partition by FCustNo order by FTIME desc) fnum from tableName ) where fnum=1; 自定义排序 select * from tableName where

  • db2笔记_4_字段值合并输出2022-08-11 14:31:59

    用逗号隔开(开头末尾都没逗号) SELECT colName1,LISTAGG(colName2, ',') FROM tableName GROUP BY colName1   用逗号隔开(末尾有逗号) SELECT colName1,replace(replace(xml2clob(xmlagg(xmlelement(NAME a, colName2||','))),'<A>',''),'<

  • postgre 批量删除表2022-07-28 10:03:40

    注意:使用时请注意,表名一定要写对,否则有可能误删!!! do$$declare select_results record;table_name varchar;begin for select_results in   select tablename from pg_tables where schemaname='表空间' and tablename like '表名%' loop table_name=select_results.tablename;

  • postgres数据库使用sqlacodegen将已存在的表生成对应的model2022-07-12 10:04:00

    需要安装的包如下:greenlet==1.1.2importlib-metadata==4.12.0inflect==5.6.1psycopg2==2.9.3sqlacodegen==3.0.0rc1SQLAlchemy==1.4.39zipp==3.8.0代码如下: import os from tools.db import DB import threading def gen_table_model(tablename): os.system(f'sqlacodegen

  • 依赖倒置原则(DIP)2022-07-04 10:35:39

    package db       /**   * 依赖倒置原则(DIP):   * 1、高层模块不应该依赖低层模块,两者都应该依赖抽象   * 2、抽象不应该依赖细节,细节应该依赖抽象   * DIP并不是说高层模块是只能依赖抽象接口,它的本意应该是依赖稳定的接口/抽象类/具象类。   * 如果

  • mybatis动态设置表名2022-06-27 11:34:53

    mybatis动态设置表名 mapper接口 List<User> selectall(@Param("tablename") String tablename); 映射文件 <select id="selectall" resultType="User">   select * from ${tablename};</select> 注意:表名是不带单引号的,所以不可以使用#{},只能使用${}

  • oracle for循环示例(for in loop)2022-06-24 11:00:24

      CREATE OR REPLACE PROCEDURE "PRO_ADATA_CHECK_TABLE2"( IN_ORG_CODE VARCHAR2, IN_BATCH_CODE VARCHAR2, OUT_TABLENAME OUT VARCHAR2 ) IS --设置变量 V_COUNT NUMBER DEFAULT 0; --数据量 V_COUNT_SQL VARCHA

  • vue+elementUI,前端导出表格,去除不需要的表格列2022-06-17 16:33:47

    码字不易,转载请注明出处,谢谢~ 遇到的问题:前端导出表格,表格中有些列不需要导出,例如操作列之类的。原理是通过ref获取表格列,把不需要导出的表格列数据去除。 解决方案 ①先在elementUI的表格组件上挂一个ref,再通过this.ref.table获取到组件的dom 点击查看代码 <el-table :da

  • MySQL2022-06-01 19:01:35

    1.mysql登录命令 MySQL -h 服务地址  -u用户名 -p密码   2.如果修改了端口怎么登录 MySQL -h:服务地址 -P:指定端口 -u:用户名 -p:密码   3.mysql使用具体哪个数据库的命令 use datadasename;   4.查询有多少表 show tables 5.查询数据库版本 show version();   6.查询表

  • Mybatis 查询前判断表是否存在2022-06-01 10:04:39

    CommonMapper.java 接口方式 @Mapper @Component public interface CommonMapper { /** * 判断表是否存在 * * @param tableName 表名称 * @return 结果 * @author yunnuo */ @Select(" SELECT COUNT(*) as count FROM information_sche

  • MySQL(查询命令)2022-05-30 20:34:56

    以什么开头以什么结尾查询 以什么开头 命令: select * from tableName where 字段 rlike '^ch' limit 5; 以什么结尾 命令: select * from tableName where 字段 rlike 'yi$' limit 5;       以别名查询 命令: select 字段 as 别名 from tableName;         最大,最小,平均,总

  • MySQL(三)2022-05-27 19:04:30

    修改数据 :根据某一个条件来修改相关的数据 1、单条数据修改 2、批量修改数据 update tableName set 字段=newContent where 表达式;     危险操作: 把某一字段下的数据都修改了 update tableName set 字段=newContent;       查询 select * from tableName; 查看所有的   s

  • MySQL5.262022-05-26 19:00:33

    MySQL命令 进入mySQL mysql -h localhost -uroot -proot  show databases: 查询当前都有哪些数据库  select version(); 查询当前mysql服务的版本号  status; 查询mysql的状态信息  select now(); 查询当前的时间  show variables like '%connection%'; 查询连接数资源

  • HBase 通过api实现表的操作2022-05-25 16:34:29

    (1)环境准备   需要用到hadoop、hbase、zookeeper (2)配置pom.xml文件 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0

  • python 批量创建 表 及表数据2022-05-18 16:00:07

    # 导入pymysqlimport pymysql# 创建连接con = pymysql.connect(host="localhost", user="root", password="123456", database="howk", port=3306)# 创建游标对象cur = con.cursor()# 编写创建表的sqlfor num in range(21, 23): # print (num) ta

  • mybatis oracle批量插入保存2022-05-18 09:04:58

    1:XML脚本 <insert id="importExcel"> insert all <foreach collection="list" item="item" index="index" separator=" "> into ${tableName} values (#{item.c1},#

  • SqlBulkCopy批量插入大数据2022-05-17 11:34:34

    1 /// <summary> 2 /// 按照SqlBulkCopy写入数据库 3 /// </summary> 4 /// <param name="dt">数据表</param> 5 /// <param name="tableName">数据库表名</param> 6 public

  • PostgreSQL库表字段信息2022-05-13 02:01:07

    数据库 SELECT * FROM "pg_database"; 表信息 SELECT "schemaname","tablename","tableowner","hasindexes","hasrules",obj_description(relfilenode,'pg_class') AS "description" FROM "

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有