首页 新闻 搜索 专区 学院

sql语句编写

0
悬赏园豆:15 [已关闭问题] 关闭于 2012-08-07 18:22
根据数据库设计,页面。
拼写一条sql语句,来查询页面要显示的内容。
 这条sql语句不好拼写,我已经拼写了好久了。告急
sql
人间烟火的主页 人间烟火 | 初学一级 | 园豆:20
提问于:2012-08-07 10:19
< >
分享
所有回答(5)
0

http://www.cnblogs.com/careyson/archive/2010/04/05/1704928.html

看上面的文章学就可以了,如果写不出来把要求贴出来好方便大家回答。

today4king | 园豆:3299 (老鸟四级) | 2012-08-07 10:50
0

不大明白,不过你可以把业务处理的sql 语句写成存储过程。然后程序中直接调用存储过程来实现某个业务。置于存储过程的相关知识,你可以在google 中查找一下。资料还是很多的。

jerry-Tom | 园豆:4077 (老鸟四级) | 2012-08-07 10:51
0

你的描述太笼统了,不明白。页面功能对数据库操作,不过就是增删改查,至于sql语句不过就是select、insert updata delete 语句

叶木木 | 园豆:252 (菜鸟二级) | 2012-08-07 11:12
0

 CRUD

~嘉言懿行~~我是煲仔饭~~ | 园豆:202 (菜鸟二级) | 2012-08-07 14:01
0

select t5.v01000,
       (select avg(seq)
          from (select t.*,
                       to_char(to_char(t.event_date, 'DDD'), '999') as seq
                  from T_LTCD_FROSTY_HIST t) t8
         where t8.v01000 = t5.v01000
         group by t8.v01000),
       t5.v04002 || '-' || t5.v04003,
       t6.v04002 || '-' || t6.v04003,
       (select avg(seq) -
               (select avg(seq)
                  from (select t.*,
                               to_char(to_char(t.event_date, 'DDD'), '999') as seq
                          from T_LTCD_FROSTY_HIST t) t8
                 where t8.v01000 = t7.v01000
                 group by t8.v01000)
          from (select t.*,
                       to_char(to_char(t.event_date, 'DDD'), '999') as seq
                  from T_LTCD_FROSTY_HIST t) t7
         where t7.v01000 = t5.v01000
         group by t7.v01000)
  from (select distinct t2.v01000 as v01000, t2.v04002, t2.v04003
          from (select t.*,
                       to_char(to_char(t.event_date, 'DDD'), '999') as seq
                  from T_LTCD_FROSTY_HIST t) t2
         where t2.seq in
               (select max(t1.seq)
                  from (select t.*,
                               to_char(to_char(t.event_date, 'DDD'), '999') as seq
                          from T_LTCD_FROSTY_HIST t) t1
                 group by t1.v01000)) t5
  left join (select distinct t3.v01000 as v01000, t3.v04002, t3.v04003
               from (select t.*,
                            to_char(to_char(t.event_date, 'DDD'), '999') as seq
                       from T_LTCD_FROSTY_HIST t) t3
              where t3.seq in
                    (select min(t4.seq)
                       from (select t.*,
                                    to_char(to_char(t.event_date, 'DDD'),
                                            '999') as seq
                               from T_LTCD_FROSTY_HIST t) t4
                      group by t4.v01000)) t6
    on t5.v01000 = t6.v01000

人间烟火 | 园豆:20 (初学一级) | 2012-08-07 18:21
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册