标签: queue-table

编写SQL来查询优先级队列表

我正在实现一个小队列来处理首先运行的进程.我在数据库中使用表来执行此操作.这是表的结构(我在SQLite中嘲笑它):

        "id" INTEGER PRIMARY KEY  AUTOINCREMENT  NOT NULL ,
        "identifier" VARCHAR NOT NULL ,
        "priority_number" INTEGER DEFAULT 15,
        "timestamp" DATETIME DEFAULT CURRENT_TIMESTAMP,
        "description" VARCHAR
Run Code Online (Sandbox Code Playgroud)

我正在尝试编写SQL来为我提供下一个可以运行的进程.以下是一些示例数据:

id  identifier  priority_number timestamp   description
1   test1   15  2009-01-20 17:14:49 NULL
2   test2   15  2009-01-20 17:14:56 NULL
3   test3   10  2009-01-20 17:15:03 NULL
4   test4   15  2009-01-20 17:15:08 NULL
5   test5   15  2009-01-20 17:32:23 NULL
6   test6   14  2009-01-20 17:32:30 NULL
7   test7   7   2009-01-20 17:32:38 NULL
8   test8   20  2009-01-20 17:32:57 NULL
9   test9 …
Run Code Online (Sandbox Code Playgroud)

sql queue priority-queue queue-table

6
推荐指数
1
解决办法
5241
查看次数

标签 统计

priority-queue ×1

queue ×1

queue-table ×1

sql ×1