s4

changeset 248:99a350b3e283

rename column names to aliases
author HIROSE Yuuji <yuuji@gentei.org>
date Sat, 16 Jul 2016 11:25:11 +0859
parents d0984b8e9f4c
children 6bb5513efb8e
files s4-funcs.sh
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line diff
     1.1 --- a/s4-funcs.sh	Sat Jul 16 11:15:42 2016 +0859
     1.2 +++ b/s4-funcs.sh	Sat Jul 16 11:25:11 2016 +0859
     1.3 @@ -1390,18 +1390,18 @@
     1.4    from article join article_s s using(id)
     1.5    where s.key='ctime'
     1.6  ), blog_title_owner as (
     1.7 -  select blg.rowid, id,
     1.8 +  select blg.rid brid, id,
     1.9          max(case key when 'title' then val end) title,
    1.10          max(case key when 'owner' then val end) owner
    1.11   from readableblogs blg, blog_s using(id) group by id
    1.12  ), acclog_user as (
    1.13    select * from acclog where user='$user' and tbl='blog'
    1.14  ), blogall as (
    1.15 - select b.id, b.rowid, b.owner, b.title, ctime, ac.author
    1.16 + select b.id, brid, b.owner, b.title, ctime, ac.author
    1.17   from blog_title_owner b, article_ctime ac
    1.18        on b.id=ac.blogid
    1.19  )
    1.20 - select rowid LINK, 
    1.21 + select brid LINK, 
    1.22          sum(max(coalesce(l.time, "0"),
    1.23  		coalesce((SELECT time FROM acclog_user
    1.24  		         WHERE tblrowid=$blogreadflagrowid), "0"))
    1.25 @@ -1411,7 +1411,7 @@
    1.26   /* owner gecos */
    1.27   (select gecos from gecoses where name=bl.owner) gecos
    1.28   from blogall bl left join acclog_user l
    1.29 -      on bl.rowid=round(l.tblrowid)
    1.30 +      on bl.brid=round(l.tblrowid)
    1.31   group by bl.id
    1.32   having "新着" > 0 order by ctime desc, "新着" desc, bl.id
    1.33   limit 10;