看看這個表,請select ... where id =任何值。可能嗎?
table
|id| |name| |order|
我必須讓行,其中name = something
和order = somevalue
,所以我寫
select `id` from `table` where `name` = 'something' and `order` = 'somevalue'
而是依賴於PHP的邏輯,有時我需要得到所有行,其中name = something
,與order
值無關。我不想改變查詢結構,因爲在實踐中有很多字段,可能的查詢次數會變得很大。所以我要查詢的保存結構,當我只需要通過名稱來選擇,我想寫的東西是這樣的:
select `id` from `table` where `name` = 'something' and `order` = any value
這可能嗎?
感謝
我會改變你構建你的查詢的方式...... – nickf 2010-05-20 22:42:29