반응형
(
(select a as a, b as b, c as c, 텍스트' as d from tableA where 조건)

UNION all

(select e as a, f as b, g as c,'텍스트' as d from tableB where 조건)
)order by a

UNION 사용시 필드 수 맞추기


iPhone 에서 작성된 글입니다.
반응형

'MYSQL' 카테고리의 다른 글

mysql custom 값으로 정렬하기  (0) 2020.04.06
group_concat  (0) 2012.02.05
mysql CONCAT  (0) 2011.05.22

+ Recent posts