How to select multiple rows by primary key in MySQL?

Posted by estourodepilha.com on Stack Overflow See other posts from Stack Overflow or by estourodepilha.com
Published on 2010-03-11T17:36:45Z Indexed on 2010/03/11 17:39 UTC
Read the original article Hit count: 165

Filed under:
|
SELECT * FROM `TABLE` WHERE
(`PRIMARY_KEY`= `VALUE1`) OR
(`PRIMARY_KEY`= `VALUE2`) OR
(`PRIMARY_KEY`= `VALUE3`) OR
(`PRIMARY_KEY`= `VALUE4`) OR
(`PRIMARY_KEY`= `VALUE5`) OR ...

This works. But is there a faster way?

© Stack Overflow or respective owner

Related posts about mysql

Related posts about select