文章分类 - 数据库
摘要:1、 安装psqlodbc-setup.exe 2、 查看驱动是否安装成功,打开控制面板->管理工具->数据源(ODBC),如下 3、 添加ODBC驱动 4、 测试驱动是否安装成功 Database=XXX Server=10.0.2.9 Port=5432; UserName=XXX Passwo
阅读全文
posted @ 2025-09-05 11:34
江境纣州
摘要:存储过程字符串拼接超长用pirnt打印显示不全,可以用select方式查询显示 ALTER procedure [dbo].[P_cust_QryCaigou] @DocNo as nvarchar(max), @BusDate as nvarchar(max) as begin declare @
阅读全文
posted @ 2025-07-11 17:32
江境纣州
摘要:db.getCollection("BarcodeMaster").aggregate([ // 删选条件 { $match: { Status:6, BarcodeType:0, Qty:{$gt:0}, Bin:{$ne:null} } }, // 按料品、仓库、库位分组,统计数量 { $gro
阅读全文
posted @ 2024-12-09 15:21
江境纣州
摘要:async function _GetDocNo(sequenceName) { let recordSequence = entityCollection.getEntity('QCProcessRecordSequence'); // returnOriginal在版本3.6中已弃用。对于3.6
阅读全文
posted @ 2024-10-15 14:38
江境纣州
摘要:// 获取设置慢查询级别 0:不启动 1:启动默认100ms 2:全启动 db.getProfilingLevel() db.setProfilingLevel(1) db.setProfilingLevel(1,200) // 200ms // 最新数据 db.system.profile.fin
阅读全文
posted @ 2024-07-16 17:28
江境纣州
摘要:1、查询要更新的表Barcode2U9 db.getCollection("Barcode2U9") .find({LotCode:{$in: [null,'']},CreatedOn:{$gt:new Date('2024-01-01T00:00:00Z')}}) 2、更新sql db.getCo
阅读全文
posted @ 2024-06-06 16:04
江境纣州
摘要:select * from MiscShipRecord m left join BarcodeMaster b on m.ItemCode=b.ItemMasterCode and m.LotNo=d.LotNo where m.id=new ObjectId("62eb55390a3211002
阅读全文
posted @ 2024-05-11 13:35
江境纣州
摘要:select * from MiscShipRecord left join DeliveryRecord on MiscShipRecord._id=new ObjectId(DeliveryRecord.SourceEntityID) Mongodb实现方式: db.MiscShipRecord
阅读全文
posted @ 2024-05-11 10:55
江境纣州
摘要:SELECT * FROM customer_linkman WHERE customer_id = #{customerLinkman.customerId} and id != #{customerLinkman.id} and is_deleted = 0 and ifnull(linkman
阅读全文
posted @ 2023-02-08 13:11
江境纣州
摘要:set @business_no="SJ000147"; SELECT *,@clue_follow_id:=id FROM clue_follow WHERE clue_id=@clue_id;
阅读全文
posted @ 2023-02-08 13:09
江境纣州
摘要:UPDATE clue INNER JOIN sys_node ON clue.id=sys_node.rel_id AND sys_node.wf_name='clue' SET clue.`status`=1,clue.node_name='线索分配',clue.node_time=sys_no
阅读全文
posted @ 2023-02-08 13:07
江境纣州
摘要:学着https://blog.csdn.net/lisky119/article/details/77528189自己做了下 我的结果:
阅读全文
posted @ 2021-09-06 13:31
江境纣州
摘要:1、虚线:traceability Link 可追溯性连接。没有外键约束,没有实际关系。逻辑外键。 2、实线:reference。有外键约束,主表不能被删除。物理外键。
阅读全文
posted @ 2021-09-06 11:32
江境纣州
摘要:本文我们将重点给出动态视图法发现数据库中缺失的索引。对于索引的调整和新建将不在本文阐述范围,后续将陆续分享相关经验。 sys.dm_db_missing_index_details 缺失索引明细,包括相等列,不等列以及包含列,执行如下脚本,并查看结果 USE WideWorldImporters;G
阅读全文
posted @ 2020-12-21 14:21
江境纣州
摘要:我们知道,合理的索引能大幅提升性能,但冗余的索引也会降低数据库性能。随着我们业务的发展,数据库的中的表、表结构、查询的内容都有可能发生变化。这样,有的索引就可能不再使用了,需要删除(因为维护索引即浪费存储,又耗费性能);而有的表则需要修改或者增加索引。本文主要给出快速确定不再使用的索引的查找方式之一
阅读全文
posted @ 2020-12-18 19:30
江境纣州
摘要:执行最慢的SQL语句 SELECT (total_elapsed_time / execution_count)/1000 N'平均时间ms' ,total_elapsed_time/1000 N'总花费时间ms' ,total_worker_time/1000 N'所用的CPU总时间ms' ,to
阅读全文
posted @ 2020-12-18 19:25
江境纣州
摘要:select PaidInID,count(distinct SignInstitutionName) from PI_PaidInMonthlyEmployeeExtra group by PaidInID having count(distinct SignInstitutionName) >
阅读全文
posted @ 2020-12-01 17:36
江境纣州
摘要:1、建表 ID uniqueidentifier Unchecked Name nvarchar(64) Unchecked Subject nvarchar(64) Unchecked Score int Unchecked 2、数据 insert into AAA_Test values(NEW
阅读全文
posted @ 2020-11-24 11:18
江境纣州
摘要:1、交换列 create table AAA_Test1 ( A int null, B int null, ); insert into AAA_Test1 values(1,2); select * from AAA_Test1 update AAA_Test1 set A=B,B=A; 不需要
阅读全文
posted @ 2020-11-19 17:19
江境纣州