SQLITE 下面的语句该怎么写
在 SQL SERVER 中的语句 是:
SELECT
(ROW_NUMBER() OVER (ORDER BY Name) - 1) / 4 + 1 AS TitleRow,
(ROW_NUMBER() OVER (ORDER BY Name) - 1) % 4 + 1 AS TitleColumn,
Name,
Color,
ThumbNailPhoto
from Production.MailLabel
在SQLITE 中该怎么写 ? 谢谢大侠
SQL code:
select
((select count(*) from MailLabel where Name<=a.Name)-1)/4+1 as TitleRow,
((select count(*) from MailLabel where Name<=a.Name)-1)%4+1 as TitleColumn,
Name,
Color,
ThumbNailPhoto
from MailLabel a
SQL code:
sqlite> select * from MailLabel;
name|color|ThumbNailPhoto
1|1|1
2|2|2
3|3|3
4|4|4
5|5|5
6|6|6
7|7|7
sqlite> select
...> ((select count(*) from MailLabel where Name<=a.Name)-1)/4+1 as TitleRow,
...> ((select count(*) from MailLabel where Name<=a.Name)-1)%4+1 as TitleColumn,
...> Name,
...> Color,
...> ThumbNailPhoto
...> from MailLabel a;
TitleRow|TitleColumn|name|color|ThumbNailPhoto
1 | 1 | 1 | 1 | 1
1 | 2 | 2 | 2 | 2
相关问答:
SELECT qsmallClass.Sname, qproducts.pmodel, qproducts.punit, qmaintain.mcount from qsmallClass INNER JOIN (qproducts INNER JOIN qmaintain ON qproducts.pid = qmaintain.pid) ON qsmallClass.Sid = qproduc ......
如题,没有主键,我只要删除前N条记录。n数值大概在千万级别的。
没有主键
有没有其它可供排序的字段?
SQL code:
delete from tb where id in (select top n id from tb)
引用
没有主键
......
C# code:
public static bool UpdateFriendUrl(int id, string cnName, string jpName, string logoUrl, string site, int order)
{
string sql = "update FriendUrl set SiteNameCN=@SiteNameC ......
mdb.execDML(L"insert into faultcode values('stu.szNumber', 'stu.szName','stu.szReason', 'stu.szStep')");
我想把结构体变量stu.szNumber中的内容存储到数据 ......
BC 生成的Sqlite DLL 只有7K ,是不能用的文件,为什么会这样??
编译过程?可能某个预处理开关没设置好,没有导出函数。
有一个sqlite3.def 文件我把它拖到工程里一起编译,这样行不?要怎样设置,我对BC 不熟 ......