no column name for column where CAST has been used

  • following query works but result set shows [no column name ] for cast(request as varchar(200)) field. How can I alias this field?

    using cast(request as varchar(200))as request does not work.

    select title,firstname,surname,required_date,address1,birth_date, cast(request as varchar(200)) ,home_phone,req_id,

    user_name,event_number,acc_number,nhi, count(*) as total from vrequest

    where req_id = '324'

    group by title,firstname,surname,required_date,address1,birth_date,cast(request as varchar(200)),

    home_phone,req_id,user_name,event_number,acc_number,nhi

  • cast(request as varchar(200)) as 'Some Alias'

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply