Aşağıda bazı nesnelerin özelliklerini bir toplu olsun benim sorgu. Optimize etmek ve kısaltmak için yine de var mı?
SELECT object_id, value, name FROM attr_text WHERE object_id IN ('43', '42', '41', '40', '39')
UNION
SELECT object_id, value, name FROM attr_varchar WHERE object_id IN ('43', '42', '41', '40', '39')
UNION
SELECT object_id, value, name FROM attr_int WHERE object_id IN ('43', '42', '41', '40', '39')
UNION
SELECT object_id, value, name FROM attr_decimal WHERE object_id IN ('43', '42', '41', '40', '39')
UNION
SELECT object_id, value, name FROM attr_datetime WHERE object_id IN ('43', '42', '41', '40', '39')
Sonuçlar:
43 red color1
43 blue color2
43 small size
42 black color1
42 big size