Skip to content

Instantly share code, notes, and snippets.

@petrstehlik
Created November 11, 2020 10:02
Show Gist options
  • Save petrstehlik/a0776874ad3f6cf4a4f8cebdb43fcc1b to your computer and use it in GitHub Desktop.
Save petrstehlik/a0776874ad3f6cf4a4f8cebdb43fcc1b to your computer and use it in GitHub Desktop.
-- 1 milion rows
CREATE TABLE `video` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created` datetime unsigned DEFAULT current_timestamp(),
`deleted` tinyint NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
)
SELECT `name`
FROM `video`
WHERE `deleted` IS FALSE
ORDER BY `created` DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment