Category Archives: SQL Assistance

esProc Exports Data by Groups

Problem source:http://bbs.csdn.net/topics/390500337. A selection from the original table (TB1): MONTH  ID   COMPANY    DEPARTMENT     JOINTIME     PROGROUP 201305    1009       1     A     A1   201108    DG 201305    1009       1     B     B1   201207    PG 201305    1009       1     C     C1   201301    SG 201305    1009       1     D     … Continue reading

Posted in SQL Assistance | Tagged , , | Leave a comment

Segmented Data Exports to Text Files of Specified Format in esProc

Problem source: http://bbs.csdn.net/topics/370240857 . Below is a selection from a database table, TB1: ID   CreateTime     Content 1     2011/10/11 6:24:21 aaa 2     2011/10/11 6:30:45 dddd 3     2011/10/11 7:10:12 dsf 4     2011/10/11 7:50:38 dffew 5     2011/10/11 7:59:59 dfae 6     2011/10/11 8:00:00 edfae  Based … Continue reading

Posted in SQL Assistance | Tagged , , , , | Leave a comment

Generate a Result Set with Dyamic Columns with esProc

Problem source:http://bbs.csdn.net/topics/391012377 . Below is a selection from the original table (tb1): Prjno      Subtask   Ddate      Num P9996     P9996-sub002 2015-01-01     123 P9996     P9996-sub002 2015-01-02     134 P9996     P9996-sub002 2015-01-03     345 P9996     P9996-sub002 2015-01-04     55 T0071     T-007-01 2015-01-01     3333 T0071     T-007-01 2015-01-02     356 T0071     … Continue reading

Posted in SQL Assistance | Tagged , , | Leave a comment

Aggregate Data by Specified Numbers of Rows with esProc

Problem source: http://bbs.csdn.net/topics/391014229 . Below is data from SL field of table tb1: SL 5 7 7 8 8 5 7 8 2 3 4 2 You need to calculate the sum of values every five rows. The expected aggregate result … Continue reading

Posted in SQL Assistance | Tagged , , , | Leave a comment

Generate a Result Set with Dyamic Columns with esProc

Problem source:http://bbs.csdn.net/topics/391012377 . Below is a selection from the original table (tb1): Prjno      Subtask   Ddate      Num P9996     P9996-sub002 2015-01-01     123 P9996     P9996-sub002 2015-01-02     134 P9996     P9996-sub002 2015-01-03     345 P9996     P9996-sub002 2015-01-04     55 T0071     T-007-01 2015-01-01     3333 T0071     T-007-01 2015-01-02     356 T0071     … Continue reading

Posted in SQL Assistance | Tagged , , , | Leave a comment

esProc Assists Java to Join Text Files

Problem Source: http://stackoverflow.com/questions/26820118/text-file-processing-using-java . JAVA lacks the class library for handling text file JOIN operation. So it’s quite complicated to write code specifically for it, especially when the files are too big to be loaded into the memory all at once. … Continue reading

Posted in SQL Assistance | Tagged , , , , | Leave a comment

Transforming Records with esProc

Problem source:http://bbs.csdn.net/topics/390991336 . Table 1 (T1) stores single-value id field and name field. A selection of the source data is as follows: id    name 1     a 2     b 3     c 4     d 5     e Table 2 (T2) stores multi-value ids … Continue reading

Posted in SQL Assistance | Tagged , , , | Leave a comment