You can also get a percentage of the records:
sel * from emp sample .05;
This will return 5% of the records from table emp. (if you have qualified records using where condition(s) the percent of records returned is based on total number of records meeting criteria).
A case statement could be used to create a temp file for the expressed purpose of sorting.
Select
table1.field1, table1.field2, (CASE table1.field1 when '1' then '1' when '2' then '4' when '3' then '5' when '4' then '2' when '5' then '3' END)
from
table1
order by 3;
www.brainbench.com has a lot of test that allow you to be "certified" in different areas. There are many SQL test available (and they are free to take).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.