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 wrap: on
line diff
--- a/s4-funcs.sh	Sat Jul 16 11:15:42 2016 +0859
+++ b/s4-funcs.sh	Sat Jul 16 11:25:11 2016 +0859
@@ -1390,18 +1390,18 @@
   from article join article_s s using(id)
   where s.key='ctime'
 ), blog_title_owner as (
-  select blg.rowid, id,
+  select blg.rid brid, id,
         max(case key when 'title' then val end) title,
         max(case key when 'owner' then val end) owner
  from readableblogs blg, blog_s using(id) group by id
 ), acclog_user as (
   select * from acclog where user='$user' and tbl='blog'
 ), blogall as (
- select b.id, b.rowid, b.owner, b.title, ctime, ac.author
+ select b.id, brid, b.owner, b.title, ctime, ac.author
  from blog_title_owner b, article_ctime ac
       on b.id=ac.blogid
 )
- select rowid LINK, 
+ select brid LINK, 
         sum(max(coalesce(l.time, "0"),
 		coalesce((SELECT time FROM acclog_user
 		         WHERE tblrowid=$blogreadflagrowid), "0"))
@@ -1411,7 +1411,7 @@
  /* owner gecos */
  (select gecos from gecoses where name=bl.owner) gecos
  from blogall bl left join acclog_user l
-      on bl.rowid=round(l.tblrowid)
+      on bl.brid=round(l.tblrowid)
  group by bl.id
  having "新着" > 0 order by ctime desc, "新着" desc, bl.id
  limit 10;

yatex.org