Mysql Sql 语句求教
表 1 table1
字段 t
记录 11000
11001
11002
表2 table2
字段 t type time
记录 11000 0 8:43
11000 1 8:43
11000 0 9:40
11000 1 9:40
11001 0 8:43
11001 1 9:30
11002 0 8:20
11002 1 9:10
11002 0 10:30
希望去到结果如下
11000 0 9:40
11000 1 9: 40
11001 0 8:43
11001 1 9:30
11002 0 10:30
11002 1 9:10
意思是 table2 记录了一些变动过程, select的时候 选择type 里时间最新的那个记录,其他的舍弃
请教这个结果如何实现。谢谢。
selec
相关问答:
执行的顺序:
1)文件浏览框(选择文件使用)
选择好文件后
点击一个导入按钮的时候 ,把上面上传框里的csv文件以一个ID为文件名,上传到**/**文件夹下
2)读取这个文件夹下的csv的文件,转换成sql
3 ......
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
SELECT a.tguildname ,SUM(a.ct) + if (SUM(b.ct) IS NULL ,0,SUM(b.ct)) from (
SELECT tg.tguildname,c.cid, (
cf.fbb + cf.fgjbb + cf.fjybb + cf.fqb + cf.fgjqb + cf.fjyqb + cf.fqib + cf. ......