SQL 语句

1、查询 select * from table where sd='' &    order by   xxx

2、删除 某一行文字
with t as ( select top(1) * from test where id = XXX ) delete from t

3、修改某一行的消息

USE TPGeneralDB
SELECT *
FROM ControlModules
ORDER BY CMType, StatTagName


USE TPGeneralDB
SELECT *
FROM tblPlantParameters
ORDER BY fldArea, fldObject, fldFunction, fldSubFunction, fldTabFunction, fldSort

/*Use TPGeneralDB
~~PRINT 'Add row number: 192'}
IF NOT EXISTS (SELECT * FROM ControlModules  WHERE HMIItemName = 'H01H01T0670')
INSERT INTO ControlModules ([CMType],[StatTagName],[ParameterAddress],[CtrlAddress],[ManualAddress],[ActualAddress],[AccessName],[PLCItemName],[HMIItemName],[ObjectType],[ExtendedParameters],[Area],[WindowName],[Included]) VALUES ('AO','H00H01T0670_SW','','','','','H01','H00H01T0670','H01H01T0670','','ExtParUsed','Area03','H01_P&ID','1')


Use TPGeneralDB
PRINT 'Add row number: 13108'
IF NOT EXISTS (SELECT * FROM tblPlantParameters  WHERE fldArea = 'HeatTreatment' AND fldObject = 'H01' AND fldFunction = 'H01' AND fldSubFunction = 'H00H01T0670' AND fldTabFunction = '' AND fldSort = '1')
INSERT INTO tblPlantParameters ([fldArea],[fldObject],[fldFunction],[fldSubFunction],[fldTabGroup],[fldTabFunction],[fldSort],[fldTag],[fldComment],[fldPhysicalUnit],[fldMinRange],[fldMaxRange],[fldType],[fldPLC],[fldReferenceSP],[fldReferenceSP_CLX],[fldAccessRights],[fldDBValue],[fldEnableBackup],[fldVisible],[fldComment_EN],[fldComment_BG],[fldComment_ZH],[fldComment_CS],[fldComment_DE],[fldComment_DA],[fldComment_ET],[fldComment_ES],[fldComment_FI],[fldComment_FR],[fldComment_EL],[fldComment_HR],[fldComment_HU],[fldComment_GA],[fldComment_IT],[fldComment_LT],[fldComment_LV],[fldComment_MT],[fldComment_NL],[fldComment_PL],[fldComment_PT],[fldComment_RO],[fldComment_RU],[fldComment_SV],[fldComment_SL],[fldComment_SK],[fldComment_XX]) VALUES (N'HeatTreatment', N'H01', N'H01', N'H00H01T0670', NULL, N'', N'1', N'H00H01_Par.H00H01T0670.Hibernation_Value', N'T0670_Hibernation_Value', N'%', N'0', N'100', N'0.#', N'H01_Par', N'H00H01_Par.H00H01T0670.Hibernation_Value', N'Program:H00H01_Par.H00H01T0670.Hibernation_Value', N'1', N'0', N'1', N'1', N'Sep Homo Hibernation Value - T0670', N'Sep Homo Hibernation Value - T0670', N'均质机休眠的值-T0670', N'均质机休眠的值-T0670', N'均质机休眠的值-T0670', N'均质机休眠的值-T0670', N'均质机休眠的值-T0670', N'均质机休眠的值-T0670', N'均质机休眠的值-T0670', N'均质机休眠的值-T0670', N'均质机休眠的值-T0670', N'均质机休眠的值-T0670', N'均质机休眠的值-T0670', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'均质机休眠的值-T0670')
PRINT 'Add row number: 13109'
IF NOT EXISTS (SELECT * FROM tblPlantParameters  WHERE fldArea = 'HeatTreatment' AND fldObject = 'H01' AND fldFunction = 'H01' AND fldSubFunction = 'H00H01T0670' AND fldTabFunction = '' AND fldSort = '2')
INSERT INTO tblPlantParameters ([fldArea],[fldObject],[fldFunction],[fldSubFunction],[fldTabGroup],[fldTabFunction],[fldSort],[fldTag],[fldComment],[fldPhysicalUnit],[fldMinRange],[fldMaxRange],[fldType],[fldPLC],[fldReferenceSP],[fldReferenceSP_CLX],[fldAccessRights],[fldDBValue],[fldEnableBackup],[fldVisible],[fldComment_EN],[fldComment_BG],[fldComment_ZH],[fldComment_CS],[fldComment_DE],[fldComment_DA],[fldComment_ET],[fldComment_ES],[fldComment_FI],[fldComment_FR],[fldComment_EL],[fldComment_HR],[fldComment_HU],[fldComment_GA],[fldComment_IT],[fldComment_LT],[fldComment_LV],[fldComment_MT],[fldComment_NL],[fldComment_PL],[fldComment_PT],[fldComment_RO],[fldComment_RU],[fldComment_SV],[fldComment_SL],[fldComment_SK],[fldComment_XX]) VALUES (N'HeatTreatment', N'H01', N'H01', N'H00H01T0670', NULL, N'', N'2', N'H00H01_Par.H00H01T0670.CIP_Value', N'T0670_CIP_Value', N'%', N'0', N'100', N'0.#', N'H01_Par', N'H00H01_Par.H00H01T0670.CIP_Value', N'Program:H00H01_Par.H00H01T0670.CIP_Value', N'1', N'0', N'1', N'1', N'Sep Homo CIP Value - T0670', N'Sep Homo CIP Value - T0670', N'均质机CIP的值-T0670', N'均质机CIP的值-T0670', N'均质机休眠的值-T0670', N'均质机休眠的值-T0670', N'均质机休眠的值-T0670', N'均质机休眠的值-T0670', N'均质机休眠的值-T0670', N'均质机休眠的值-T0670', N'均质机休眠的值-T0670', N'均质机休眠的值-T0670', N'均质机休眠的值-T0670', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'均质机休眠的值-T0670')
PRINT 'Add row number: 13110'
IF NOT EXISTS (SELECT * FROM tblPlantParameters  WHERE fldArea = 'HeatTreatment' AND fldObject = 'H01' AND fldFunction = 'H01' AND fldSubFunction = 'H00H01T0670' AND fldTabFunction = '' AND fldSort = '3')
INSERT INTO tblPlantParameters ([fldArea],[fldObject],[fldFunction],[fldSubFunction],[fldTabGroup],[fldTabFunction],[fldSort],[fldTag],[fldComment],[fldPhysicalUnit],[fldMinRange],[fldMaxRange],[fldType],[fldPLC],[fldReferenceSP],[fldReferenceSP_CLX],[fldAccessRights],[fldDBValue],[fldEnableBackup],[fldVisible],[fldComment_EN],[fldComment_BG],[fldComment_ZH],[fldComment_CS],[fldComment_DE],[fldComment_DA],[fldComment_ET],[fldComment_ES],[fldComment_FI],[fldComment_FR],[fldComment_EL],[fldComment_HR],[fldComment_HU],[fldComment_GA],[fldComment_IT],[fldComment_LT],[fldComment_LV],[fldComment_MT],[fldComment_NL],[fldComment_PL],[fldComment_PT],[fldComment_RO],[fldComment_RU],[fldComment_SV],[fldComment_SL],[fldComment_SK],[fldComment_XX]) VALUES (N'HeatTreatment', N'H01', N'H01', N'H00H01T0670', NULL, N'', N'3', N'H00H01_Par.H00H01T0670.Other_Fixed_Value', N'T0670_Other_Fixed_Value', N'%', N'0', N'100', N'0.#', N'H01_Par', N'H00H01_Par.H00H01T0670.Other_Fixed_Value', N'Program:H00H01_Par.H00H01T0670.Other_Fixed_Value', N'1', N'0', N'1', N'1', N'Sep Homo Other_Fixed Value - T0670', N'Sep Homo Other_Fixed Value - T0670', N'均质机其他固定的值-T0670', N'均质机休眠的值-T0670', N'均质机休眠的值-T0670', N'均质机休眠的值-T0670', N'均质机休眠的值-T0670', N'均质机休眠的值-T0670', N'均质机休眠的值-T0670', N'均质机休眠的值-T0670', N'均质机休眠的值-T0670', N'均质机休眠的值-T0670', N'均质机休眠的值-T0670', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'Sep booster pump capacity 1 - T0310', N'均质机休眠的值-T0670')
*/

Update tblPlantParameters set fldVisible = '1' where fldSubFunction = 'EMD_G0670_CoordV1'

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值