Here the Situation . I am having 2 million records in table .
Just consider the contacts tables has id filed. and id has different number . But now i want to find the smallest and largest id from contacts table .
Here the Situation . I am having 2 million records in table .
Just consider the contacts tables has id filed. and id has different number . But now i want to find the smallest and largest id from contacts table .
SELECT min(id_field),max(id_field) FROM table;
This will work for both tables.