【问题标题】:c# /xamarin forms get randoms items form sqlite datababec# /xamarin forms从sqlite数据库中获取随机项
【发布时间】:2018-02-08 10:04:21
【问题描述】:

我正在使用 sqlite-net-pcl click here to see

我的问题是:我正在寻找一种从我的 sqlite 数据库中获取随机项目的方法,我已经找到了查询,但我看不到如何使用 sqlite 数据库来做到这一点

查询如下:

 SELECT * FROM table WHERE id IN(SELECT id FROM table ORDER BY RANDOM() LIMIT x)

对不起我的问题。 在此先感谢,如果有更好的解决方案,我会采取

【问题讨论】:

  • 使用'select top x'而不是limit

标签: c# sqlite xamarin.forms


【解决方案1】:

使用Query 方法

return db.Query<TypeName> ("select * from TableName");

【讨论】:

    猜你喜欢
    • 2017-02-28
    • 2014-06-30
    • 2014-04-02
    • 2017-11-28
    • 2021-06-06
    • 1970-01-01
    • 2018-11-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多