We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d0424d commit 2e94937Copy full SHA for 2e94937
sql-queries-11/lock-single-row-mysql/select-for-update.sql
@@ -1,28 +1,28 @@
1
-//First Session
+// First Session
2
START TRANSACTION;
3
SELECT *
4
FROM DEPARTMENT
5
WHERE id=5
6
FOR UPDATE;
7
8
-//Second Session
+// Second Session
9
10
11
12
FOR SHARE;
13
14
15
COMMIT;
16
17
18
19
UPDATE DEPARTMENT
20
SET code='TEMP'
21
WHERE id<5 OR id>5;
22
23
24
COMMIT
25
26
27
28
0 commit comments