August 27, 2014

Teradata SQL Aggregate functions example

select
car_key,
sum(deprn_amt) sum_dep,
avg(accum_deprn_amt) avg_dep,
max(accum_deprn_amt) max_dep,
min(accum_deprn_amt) min_dep,
count(*) cnt
from fact_car
having sum_dep != max_dep and cnt >10 and cnt < 20 and max(nk_deprn_run_ts) > date '2014-06-01'
group by asset_key
order by max_dep desc

August 26, 2014

Teradata SQL TOP function

select top 5 * from person_tb where create_date > date '2014-10-19'

Forward vs Reverse Proxy server

The concept about Forward and Reverse proxy is explained well in this blog. http://www.jscape.com/blog/bid/87783/Forward-Proxy-vs-Reverse-Proxy

Different types of VPN

Different types of VPNs:
1. Site-to-Site VPN,
2. Dynamic VPN (DMVPN),
3. Client VPN,
4. SSLVPN
is explained clearly in this blog. http://reggle.wordpress.com/2012/03/05/different-types-of-vpn-explained/

August 18, 2014

Oracle Trunc function

Run on 8/18/2014
select trunc(sysdate, 'YYYY') from dual -> 01-JAN-14
select trunc(sysdate, 'MM') from dual -> 01-AUG-14
select trunc(sysdate, 'DD') from dual -> 18-AUG-14

August 13, 2014

Date in Teradata SQL condition

select * from payments where pay_dt > date '2014-01-01'

CHECK constraint

CONSTRAINT arrive_date_check CHECK (a_date >= d_date)

Quoting: http://www.info.teradata.com/HTMLPubs/DB_TTU_14_00/index.html#page/Database_Management/B035_1094_111A/ch12.053.31.html

August 5, 2014

Timestamp format

select count(*) from table1 where last_updt_ts > cast('2014-01-01:00:00:00' as timestamp format 'yyyy-mm-dd:hh:mi:ss')