티스토리 뷰

728x90
반응형

쿼리문 MS-SQL

/*********************************************************************

DB : totooutdoor

name : [up_st_tto_t_brand_brandList_select]

auth : 장정훈

date : 2014-11-18

desc : 브랜드 목록


exec up_st_tto_t_brand_brandList_select

*********************************************************************/

alter proc [dbo].up_st_tto_t_brand_brandList_select

as


begin

select 

'ㄱ' as CharacterType

, uid as BrandUid

, name as BrandNameEnglish

, hanName as BrandKoreaName

from t_brand with(nolock)

where isConfirm = 'T' 

and hanName between 'ㄱ' and '깋' or hanName between 'ㄲ' and '낗'

union all

select 

'ㄴ' as CharacterType

, uid as BrandUid

, name as BrandNameEnglish

, hanName as BrandKoreaName

from t_brand with(nolock)

where isConfirm = 'T' 

and hanName between 'ㄴ' and '닣'

union all

select 

'ㄷ' as CharacterType

, uid as BrandUid

, name as BrandNameEnglish

, hanName as BrandKoreaName

from t_brand with(nolock)

where isConfirm = 'T' 

and hanName between 'ㄷ' and '딯' or hanName between 'ㄸ' and '띻'

union all

select 

'ㄹ' as CharacterType

, uid as BrandUid

, name as BrandNameEnglish

, hanName as BrandKoreaName

from t_brand with(nolock)

where isConfirm = 'T' 

and hanName between 'ㄹ' and '맇'

union all

select 

'ㅁ' as CharacterType

, uid as BrandUid

, name as BrandNameEnglish

, hanName as BrandKoreaName

from t_brand with(nolock)

where isConfirm = 'T' 

and hanName between 'ㅁ' and '밓'

union all

select 

'ㅂ' as CharacterType

, uid as BrandUid

, name as BrandNameEnglish

, hanName as BrandKoreaName

from t_brand with(nolock)

where isConfirm = 'T' 

and hanName between 'ㅂ' and '빟' or hanName between 'ㅃ' and '삫'

union all

select 

'ㅅ' as CharacterType

, uid as BrandUid

, name as BrandNameEnglish

, hanName as BrandKoreaName

from t_brand with(nolock)

where isConfirm = 'T' 

and hanName between 'ㅅ' and '싷' or hanName between 'ㅆ' and '앃'

union all

select 

'ㅇ' as CharacterType

, uid as BrandUid

, name as BrandNameEnglish

, hanName as BrandKoreaName

from t_brand with(nolock)

where isConfirm = 'T' 

and hanName between 'ㅇ' and '잏'

union all

select 

'ㅈ' as CharacterType

, uid as BrandUid

, name as BrandNameEnglish

, hanName as BrandKoreaName

from t_brand with(nolock)

where isConfirm = 'T' 

and hanName between 'ㅈ' and '짛' or hanName between 'ㅉ' and '찧'

union all

select 

'ㅊ' as CharacterType

, uid as BrandUid

, name as BrandNameEnglish

, hanName as BrandKoreaName

from t_brand with(nolock)

where isConfirm = 'T' 

and hanName between 'ㅊ' and '칳'

union all

select 

'ㅋ' as CharacterType

, uid as BrandUid

, name as BrandNameEnglish

, hanName as BrandKoreaName

from t_brand with(nolock)

where isConfirm = 'T' 

and hanName between 'ㅋ' and '킿'

union all

select 

'ㅌ' as CharacterType

, uid as BrandUid

, name as BrandNameEnglish

, hanName as BrandKoreaName

from t_brand with(nolock)

where isConfirm = 'T' 

and hanName between 'ㅌ' and '팋'

union all

select 

'ㅍ' as CharacterType

, uid as BrandUid

, name as BrandNameEnglish

, hanName as BrandKoreaName

from t_brand with(nolock)

where isConfirm = 'T' 

and hanName between 'ㅍ' and '핗'

union all

select 

'ㅎ' as CharacterType

, uid as BrandUid

, name as BrandNameEnglish

, hanName as BrandKoreaName

from t_brand with(nolock)

where isConfirm = 'T' 

and hanName between 'ㅎ' and '힣'

union all

select 

'etc' as CharacterType

, uid as BrandUid

, name as BrandNameEnglish

, hanName as BrandKoreaName

from t_brand with(nolock)

where isConfirm = 'T' 

and hanName not between '가' and '힣'

end



코드 C#

IList<BrandEntityL> brandLIst = this.brandMall.BrandList();

// LINKQ

mainEntity.CharacterTypeㄱ = from a in brandLIst                        

where a.CharacterType == "ㄱ"

select a;



728x90
반응형