This is an automated archive.

The original was posted on /r/mysql by /u/West-Tradition-200 on 2023-07-02 17:08:20+00:00.


INSERT INTO tutorials(id, title, description, published, createdAt, updatedAt) SELECT 10, 'test2', 'desc2', 1, '2018-01-01 00:00:00', '2018-01-01 00:00:00' FROM DUAL WHERE (SELECT COUNT(*) FROM tutorials) < 5 For example I have the above query that seems to work ok when I want maximum number of rows e.g. or of course something more relevant/useful. Is this safe generally especially when parallelism takes place? Or should I use the check constraint? The value though I want could change at anytime (dynamic) for future inserts.