-
Notifications
You must be signed in to change notification settings - Fork 0
/
refresh_nav.sql
22 lines (17 loc) · 1.4 KB
/
refresh_nav.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
select FUNDHOUSE.FUNDHOUSECODE AS FUNDCODE, SCHEME_TYPE.TYPE_ID AS TYPEID, min(SCHEMES.TO_DATE) AS LASTUPDTDT from SCHEMES INNER JOIN SCHEME_TYPE ON SCHEMES.SCHEMETYPEID = SCHEME_TYPE.ROWID INNER JOIN FUNDHOUSE ON SCHEMES.FUNDHOUSECODE = FUNDHOUSE.FUNDHOUSECODE WHERE FUNDCODE = 39 AND TYPEID = 2
select FUNDHOUSE.FUNDHOUSECODE AS FUNDCODE, SCHEME_TYPE.TYPE_ID AS TYPEID, min(SCHEMES.TO_DATE) AS LASTUPDTDT from SCHEMES
INNER JOIN SCHEME_TYPE ON SCHEMES.SCHEMETYPEID = SCHEME_TYPE.ROWID
INNER JOIN FUNDHOUSE ON SCHEMES.FUNDHOUSECODE = FUNDHOUSE.FUNDHOUSECODE
WHERE FUNDCODE = 39 AND TYPEID = 2
select FUNDHOUSE.FUNDHOUSECODE, SCHEME_TYPE.TYPE_ID , SCHEMES.SCHEMECODE, SCHEMES.SCHEMENAME, SCHEMES.TO_DATE from SCHEMES
INNER JOIN SCHEME_TYPE ON SCHEMES.SCHEMETYPEID = SCHEME_TYPE.ROWID
INNER JOIN FUNDHOUSE ON SCHEMES.FUNDHOUSECODE = FUNDHOUSE.FUNDHOUSECODE
ORDER BY FUNDHOUSE.FUNDHOUSECODE ASC, SCHEME_TYPE.TYPE_ID ASC, SCHEMES.TO_DATE ASC
SELECT FUNDHOUSE.FUNDHOUSECODE, SCHEME_TYPE.TYPE_ID, t1.TO_DATE as LASTUPDATEDT, min(t2.TO_DATE) as MIN_LASTUPDATEDT
FROM SCHEMES t1
INNER JOIN FUNDHOUSE ON FUNDHOUSE.FUNDHOUSECODE = t1.FUNDHOUSECODE
INNER JOIN SCHEME_TYPE ON SCHEME_TYPE.ROWID = t1.SCHEMETYPEID
INNER join SCHEMES t2 on t1.SCHEMECODE = t2.SCHEMECODE
--WHERE t1.MASTER_ROWID = 2 and t1.SCHEMECODE = t2.SCHEMECODE
--GROUP BY t1.SCHEMECODE , t1.PURCHASE_DATE
--ORDER BY t1.SCHEMECODE ASC