Tuesday, January 8, 2013

ORDER BY clause does not work in sub query

the ORDER BY clause in the SQL (any database) does not work if we use it inside a sub query, because it sorts the result set after completing all filtering conditions and calculations.

ORDER BY clause has the last priority among all clauses (i.e. SELECT, WHERE, GROUP BY, HAVING..etc) in SQL because its nothing to do with the calculations, its just for the presentation of the resulted data set. the following query doesn't work.


SELECT * FROM dual WHERE dummy IN (SELECT * FROM dual ORDER BY dummy);

instead following query will work.


SELECT * FROM dual WHERE dummy IN (SELECT * FROM dual)  ORDER BY dummy;

Wednesday, April 28, 2010

Ignited Minds: 20 innovators who are changing our lives

Sheikh Jehangir cannot read or write, hasn't been trained in any vocational skill and started working at the age of 11 to support his family. Yet, the 50-year-old car painter in Jalgaon, Maharashtra, has a patent to his name, and has applied for a second one. His latest innovation, a scooter-powered flourmill created to help his wife grind wheat even during long power cuts, inspired an invention featured in the monster hit 3 Idiots. Jehangir's shop was removed from the roadside in a cleanliness drive and even though he was promised a new one by the government, he has not received it yet. What's more, when Jehangir applied to a public sector for a loan to support his innovation, he was refused one without a collateral of Rs 15 lakh.

Wednesday, March 31, 2010

The Power of the human mind

Dear Friends,

Some thing to chew... take a break..
another example to show English is a funny language...! !!???


I can read it , can You?
fi yuo cna raed tihs,
yuo hvae a sgtrane mnid too.
Cna yuo raed tihs?
Olny 55 plepoe out of 100 can.

Sunday, March 21, 2010

JAVA interview Basic questions and answers for freshers

1)What is OOPs? 
Ans: Object oriented programming organizes a program around its data,i.e.,objects and a set of well defined interfaces to that data.An object-oriented program can be characterized as data controlling access to code.

2)what is the difference between Procedural and OOPs?
Ans: a) In procedural program, programming logic follows certain procedures and the instructions are executed one after another. In OOPs program, unit of program is object, which is nothing but combination of data and code.

b) In procedural program,data is exposed to the whole program whereas in OOPs program,it is accessible with in the object and which in turn assures the security of the code.

Saturday, March 20, 2010

Java Program for intializing and printing a Two-dimensional array

public class Twoarray
{
    public static void main(String args[])
    {
        int a[][]={{5,2},{1,4},{2,3}};
    System.out.println("given Two-dimensional array is: ");
        for(int i=0;i<3;i++)
        {
            for(int j=0;j<2;j++)
            {
                System.out.print(a[i][j]);
            }
        System.out.print(" ");
        }
    }
}