ReStart

DS 2017. 7. 19. 14:18

다시 재정리~~~

Posted by pwsunf
,

대용량 로그 뷰어

Util 2013. 1. 11. 09:30

Large Text File Viewer 5.2


다운로드


http://www.swiftgear.com/ltfviewer/features.html


Posted by pwsunf
,

[DB2] order by sum()

Dev/DB 2012. 7. 20. 14:59

order by sort-key 부분에 들어가는 값

sum()이 들어가면 안됨!!!(ms-sql)은 정상적으로 원하는 결과를 가져옴. 


alias를 사용해서 가져와야 함.


select sum(a) as a

...

order by a 


------------------


sort-key
column-nameinteger, or sort-key-expression that specifies the value that is to be used to order the rows of the result of the subselect.

If a single sort-key is identified, the rows are ordered by the values of that sort-key. If more than one sort-key is identified, the rows are ordered by the values of the first sort-key, then by the values of the second sort-key, and so on. sort-key cannot be a LOB or XML expression.

The result table can be ordered by a named column in the select list by specifying a sort-key that is an integer or the column name. The result table can be ordered by an unnamed column in the select list by specifying a sort-key that is an integer or, in some cases, by a sort-key-expression that matches the expression in the select list.

column-name
An identifier that usually identifies a column of the result table. In this case, column-name must be the name of a named column in the select list. If the fullselect includes a set operator, the column name cannot be qualified.

If the query is a subselect, the column-name can also identify a column name of a table, view, or nested table expression identified in the FROM clause, including a column that is defined as implicitly hidden. The subselect must not include any of the following:

  • DISTINCT in the select list
  • Aggregate functions in the select list
  • GROUP BY clause
integer
Start of changeAn unsigned integer that must be greater than 0 and not greater than the number of columns in the result table. The integer n identifies the nth column of the result table.End of change
sort-key-expression
Start of changeAn expression that is not simply a column-name or unsigned integer constant. The query to which ordering is applied must be a subselect to use this form of the sort-key.End of change

The sort-key-expression cannot include an expression that is not deterministic or a function that is defined to have an external action except for the RID built-in function and the ROW CHANGE expression. Any column name in the expression must conform to the rules described Column names in sort keys. If sort-key-expression includes an aggregate function, the input arguments to that function must not reference a named column in the select list that is derived from an aggregate function. An expression cannot be specified if DISTINCT is used in the select list of the subselect.

If the subselect is grouped, the sort-key-expression might or might not be in the select list of the subselect. When sort-key-expression is not in the select list the following rules apply:

  • Each expression in the ORDER BY clause must either:
    • Use one or more grouping expressions
    • Use a column name that either unambiguously identifies a grouping column of R or is specified within a aggregate function.
  • Each expression in the ORDER BY clause must not contain a scalar fullselect. 


출처 : http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/topic/com.ibm.db2z10.doc.sqlref/src/tpc/db2z_sql_orderbyclause.htm


Posted by pwsunf
,