order by time
[zc] / sql-grep-to-ids.sh
index 0dafbbb..e700f1a 100755 (executable)
@@ -3,4 +3,4 @@
 ids=$( grep $1 subvision-numbers.txt | awk '{ print $2 }' | xargs echo -n | sed 's/ /,/g' )
 #echo "select pn,count(pn),min(time),max(time) from zc where pn in ($ids) group by pn order by max" | psql zc
 echo "select (select sub from sub where pn = zc.pn),(select name from sub where pn = zc.pn),pn,count(pn),min(time),max(time) from zc where pn in ($ids) group by pn order by max" | psql zc
-echo "select * from zc where pn in ($ids) | psql zc"
+echo "select * from zc where pn in ($ids) order by time | psql zc"