tags:

views:

80

answers:

2

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 .

+4  A: 
SELECT min(id_field),max(id_field) FROM table;

This will work for both tables.

Zenham
+4  A: 

you're looking for min and max.

SELECT min(id),max(id) FROM table;
Silfverstrom