sql

Diff code posted
created at 27 Dec 07:25, updated at 28 Dec 12:25

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
    select
      hh.affiSid,
      hh.affiName,
      hh.seedCode,
      hh.seedKind,
      hh.seedValue,
      j.seedName,
      ifnull(hh.category, '') category,
      ifnull(g.codeName,'') categoryName,
      hh.regDateTime
    from 
               (select ee.affisid, ee.affiname, aa.seedCode, aa.seedKind, aa.seedValue, category, concat(aa.regDate, aa.regTime) regDateTime
                            from (select cmpid, seedCode, seedKind, seedValue, category, affisid, regDate, regTime from SeedHistory_${searchYearMonth}) aa ,
                                   (select dishttp://coderay.rubychan.de/doc/tinct cmpid from AffiliationMember where memberid=#{userid}) bb,
                                   (select affisid, affiname from AffiliationService) ee
                 where aa.cmpid   = bb.cmpid
                    and aa.affisid   = ee.affisid) hh
               left outer join Code g on g.codeId = hh.category
              left outer join SeedCode j on j.seedCode = hh.seedCode
    where 1=1
981 Bytes in 2 ms with coderay