//import { หีเน่าเน่า} from "เธอ";
async function animate (ele) {
for (let index = 0; index < 100; index++) {
ele.style.left = i + 'px';
await sleep(16);
}
}
วกกลับมา RDBMS (คุณเอิ้นเว่ามาว่า เขียน Store Procedure ไม่เป็น)
ผมผ่านมาร้อยเย็ดเจ็ดย่านน้ำทุก RDBMS
SQL Server Code (SQL)
DECLARE @intFlag INT
SET @intFlag = 1
WHILE (@intFlag <= 5) BEGIN
PRINT @intFlag
SET @intFlag = @intFlag + 1
CONTINUE;
IF @intFlag = 4 -- This will never executed (พอแล้ว)
BREAK;
END
GO
Date :
2019-06-14 09:25:57
By :
หน้าฮี
No. 10
Guest
ใช้ Microsoft SQL server Management Studio
ลองคัดลอก (Copy) แล้ว รันดู (F5 - Debug)
Code (SQL)
SET NOCOUNT OFF;
DECLARE @tmp_TableA TABLE (grpName varchar(10),
grpValue varchar(10),
grpID int,
rowID int)
INSERT INTO @tmp_TableA
SELECT 'หอย', 'value1', 1, 1 UNION
SELECT 'หอย', 'value2', 1, 2 UNION
SELECT 'งาม', 'value3', 2, 3 UNION
SELECT 'งาม', 'value4', 2, 4 UNION
SELECT 'เพราะ', 'value5', 3, 5 UNION
SELECT 'เพราะ', 'value6', 3, 6 UNION
SELECT 'ขน', 'value7', 4, 7 UNION
SELECT 'ขน', 'value8', 4, 8 UNION
SELECT 'คน', 'value9', 5, 9 UNION
SELECT 'งาม', 'value10', 6, 10 UNION
SELECT 'เพราะ', 'value11', 7, 11
DECLARE @cnt int = 1;
DECLARE @max int = (SELECT MAX(rowID) FROM @tmp_TableA);--DECLARE @max int = (SELECT MAX(rowID) FROM @tmp_TableA);
DECLARE @grpIDOld int = 1
DECLARE @grpIDNew int = 1
DECLARE @grpName varchar(10) = ''
WHILE (@cnt <= @max) BEGIN
SELECT @grpName = GrpName, @grpIDNew = GrpID FROM @tmp_TABLEA WHERE rowID = @cnt
--SELECT @grpName = GrpName, @grpIDNew = GrpID FROM @tmp_TABLEA WHERE rowID = @cnt
IF @@ROWCOUNT > 0 BEGIN
--SET NOCOUNT ON -- OR PRINT 'Hi' for Reset RowCount = 0
IF @grpIDOld <> @grpIDNew BEGIN
SET @grpIDOld = @grpIDNew
PRINT CAST(@cnt AS VARCHAR) + N' เปลียนกลุ่ม'
END
ELSE BEGIN
UPDATE @tmp_TABLEA SET GrpName = '' WHERE rowID = @cnt --UPDATE @tmp_TABLEA SET GrpName = '' WHERE rowID = @cnt
END
-- IF ELSE can Reset RowCount = 0
END
ELSE BEGIN
PRINT CAST(@cnt AS VARCHAR) + N' หาไม่เจอ'
END
SET @cnt = @cnt + 1
END
SELECT * FROM @tmp_TAbleA ORDER BY grpID
GO