James Tu wrote:
I was a little to quick with the send button.

Can you do a query like this:

(I know that the * syntax is not correct, but is there something equivalent to it?

SELECT from cars
WHERE
    make=5 AND
    model=* AND
    body_color=7 AND
    tire_type = * AND
    hub_caps_type = 1


If you could perform a query like the one above, would MySQL still use the multi-column index that I set up?

-James

Select * from cars
WHERE
    make=5 AND
    model LIKE '%' AND
    body_color=7 AND
    tyre_type LIKE '%' AND
    hub_caps_type = 1

If your multi-column index starts with model or tyre_type, then no.
The index can be used down to, but not including the first column that is compared against '%'.

--
Gerald L. Clark
Supplier Systems Corporation

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to