It is long time since last update, as every day I was engaged in busy work, and for last whole week I was assigned to clean up data for several database dump files, each with around several thousands of records, and during the work, I got chances to review SQL. Following are some notes:
1. To select across tables->Join
e.g., select a.* from tbl1 a join tbl2 b on a.field1=b.field2 where field3...
2. To view records by groups-> group by
e.g., select count(*), field1, field2 from tbl1 group by field1, field2
3. To_Char() function
e.g., select to_char(field1, 'YYYYMMDD') from tbl1
4. Besides that, i learnt a bit of PL/SQL also, which helps to write complex queries to do complex data manipulations.. however, still on the go.
Sunday, August 2, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment