📜  返回随机行 sqlite - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:10.695000             🧑  作者: Mango

代码示例1
// Use db.all()
let Query = `SELECT * FROM Table ORDER BY RANDOM() LIMIT 3;`
db.all(Query, (err, data) => {
    if (err) {
        console.log(err)
        return;
    }
    if (data) {
        console.log(data)
    } else {
        console.log("Not Enough Data")
    }
})