Hello everybody!
I need some help with a simple query.
I've got a problem with getting a maximum value from a very large table
(10000000+ rows):
I have table:
CREATE TABLE TABLE_A
(
COL1 INT,
COL2 INT,
CONSTRAINT PK PRIMARY KEY (COL1, COL2)
)

and when I want to get the maximum value for col1:
SELECT MAX(COL1) FROM TABLE_A WHERE COL2 = 1
it takes a large amount of time.
I created an index on column COL1, but it doesn't work.

                Bc. Ferenc Lengyel

                Address:                Prievozská 6/A, Bratislava 821 09,
Slovakia
                Phone Number:   +421 (7) 58222 222, +421 (7) 58222 407
                E-mail address: mailto:[EMAIL PROTECTED]

Reply via email to