2uzhan.com
Advertisement
Now Place:2uzhan.com » Index name instead of column names in WHERE clause. Is it possible?

Index name instead of column names in WHERE clause. Is it possible?

MySQL @ July 13, 2005   Views:0

Hello,

I have database with several tables
t1 (PAC) table have index "index_1" which is consisted of 2 columns (PAC.c1 & PAC.c2).

Among other usual conditions I want to use index name instead of column names in WHERE clause. Is it possible??

You can see following SQL:

SELECT PAC.c1, PAC.c2, PAC.c3, DAR.c1, ADR.c1, SER.c1
FROM t1 PAC
LEFT JOIN t2 DAR ON PAC.k1 = DAR.k1
LEFT JOIN t3 ADR ON PAC.k2 = ADR.k1
LEFT JOIN t4 SER ON ADR.k1 = SER.k1 AND SER.c1 = 3
WHERE PAC.c5 <> '1' AND PAC.c6 <> '1' AND PAC.c7 <> '0' AND
PAC.Index_2 LIKE '%something%' AND PAC.Index_2 LIKE '%something_2%'
LIMIT 0, 11

Thanks in advance,
Dacha

--------------Solutions-------------

I have forgotten to say that I have MySQL v. 4.1.12

Tags:
© 2018 2uzhan.com Contact