テーブルobjects
id name is_animal
-----------------------
1 dog 1
2 cat 1
3 chair 0
4 rabbit 1
クエリ
(SELECT name AS animal_name FROM objects WHERE is_animal = 1)
UNION
(SELECT name AS object_name FROM objects WHERE is_animal = 0)
そしてその結果
[animal_name] => dog
[animal_name] => cat
[animal_name] => rabbit
[animal_name] => chair // expected: [object_name] => chair
私はすでにAS
2番目のSELECTで使用しましたが、なぜanimal_name
代わりに返されるのobject_name
ですか?