정리 작업중

[MySQL] As 별명(ALIAS)

Xie Yun 2022. 10. 12. 17:28
반응형

SQL 쿼리 결과 생성 시 길어지는 컬럼명에 대해 별명을 사용해 표시하는 기능

 

별명 As 키워드 사용 전

select city.countryCode, Country.GovernmentForm from city join country on  city.CountryCode = country.Code;

 

별명 As 키워드 사용시

select city.countryCode As Code, Country.GovernmentForm As GF from city join country on  city.CountryCode = country.Code;

반응형

'정리 작업중' 카테고리의 다른 글

[MySQL] SQL 조건문 CASE WHEN END  (0) 2022.10.12
[MySQL] 뷰 VIEW  (0) 2022.10.12
[MySQL] 문자열 유용한 함수들  (0) 2022.10.12
[MySQL] 집합함수(Aggregation Function)  (0) 2022.10.12
[MySQL] 결과값 일부 조회 LIMIT  (0) 2022.10.12