Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

return random rows sqlite

// 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")
    }
})
 
PREVIOUS NEXT
Tagged: #return #random #rows #sqlite
ADD COMMENT
Topic
Name
4+6 =