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
相关问答:
sqlite不会不支持and 吧?
select * from table where rootid=2 and uid=0 order by orderid asc,id asc
使用上面的语句查询不到数据,可是符合的条件是存在的.我取掉and,就有记录,不知道怎么回事
select * f ......
如题,没有主键,我只要删除前N条记录。n数值大概在千万级别的。
没有主键
有没有其它可供排序的字段?
SQL code:
delete from tb where id in (select top n id from tb)
引用
没有主键
......
怎么让sqlite支持中文,谁解决了就给他100分
难道SQLITE不支持中文吗????????
读取出来时乱码
这样试试
C# code:
using System.Data;
using System.Data.SQLite;
//...
using (SQLiteConnec ......
我用evc编写的程序,将对话框中的数据存入数据库,第一次可以存入,不过第二次输入的数据不能存入到数据库中。
下面是我的程序
UpdateData(TRUE); // TODO: Add your control notification handler code here ......