このようなテーブルがあります
id type type_id cust ip_address datetime
395 Category 5 0 119.63.196.29 2012-11-27 00:34:21
394 Cart 812 0 84.208.217.178 2012-11-27 00:31:48
393 Cart 812 0 84.208.217.178 2012-11-27 00:31:41
392 Cart 812 0 84.208.217.178 2012-11-27 00:31:35
391 Product 812 0 84.208.217.178 2012-11-27 00:31:34
個別の type+type_id データを持つ id desc で並べられた 4 つの行を選択したいと考えています。
type と type_id の組み合わせはすでに ID 394 にあるため、クエリの結果から ID 393 と 392 が削除されます。
疑似コード: select * from table where type and type_id is different from the resultset, order by id desc limit 4