易截截图软件、单文件、免安装、纯绿色、仅160KB
热门标签: c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 最新文章 : sql

求一个sql语句

name列,words列
生成一个新列
结果为name+"说:"+words
如:
name  words
--------------
I      hi

===>
saywords
--------------
I说:hi
SQL code:
select name+'说:'+words as saywords from tb

SQL code:
select [name],words,saywords ......

SQL 错误 在哪里

select  s.name,
sum(if(o.cp>0,1,0)) as c,
sum(if(o.cp=0,1,0)) as h,
sum(o.p) as p,
sum(o.u) as u,
published,s.id
from table_s as s inner join table_o as o
on s.middle=o.middle group by s.name where published = 1 ORDER BY s.id asc

上面的sql语句 去掉 where publish ......

请教SQL语句怎么写?

例表如下:

姓名      部门        职级      工资等级

张三      1          A          01
李四      2          A    ......

一sql语句能实现吗

  数据
  |Field1| Field2|  Field3|
  | F1  |  x1        1
  | F2  |  xx1        3
  | F1  |  x1        2
  | F1  |  x2      & ......

sql用户数据统计

我有一个表,里面包含有很多用户每次的摇奖记录,

username      d1    d2

aa            4      5

bb            4      2

aa          & ......

这条SQL怎么优化

SQL code:

SELECT cls.*, yplan.*
from Mpt_CostItem cls INNER JOIN
Mpt_YearPlan yplan ON cls.CostItem_ID = yplan.YearPlan_ItemID
GROUP BY yplan.YearPlan_ItemID
ORDER BY yplan.YearPlan_ID

上面的语运行肯定是通不过的如果改成这样
SQL code:

SELECT max(cls.字段), max(yplan.字段)
f ......
总记录数:3315; 总页数:553; 每页6 条; 首页 上一页 [449] [450] [451] [452] 453 [454] [455] [456] [457] [458]  下一页 尾页
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号