0

I am trying print a vaules retrived from select but, I could not find the way in MSSQL.

I mean I have query

select str_id,value from board (this is a simplify query, the one has several joins)

this show

CIM.MotherID,0xfffffff
CIM.MotherID,0x1234234

I would like something like to get

Mother ID, Oxffffff
Mother ID, Ox123213

I tried with IF statement but I could not get it Do you have any clue?

Agus
  • 1,604
  • 2
  • 23
  • 48

1 Answers1

0
select STUFF(SUBSTRING(str_id,5,12),6,7,' '),value from board (this is a simplify query, the one has several joins)
Teja
  • 13,214
  • 36
  • 93
  • 155
  • thank you, i have 3 different possible return TRIM_Processor.ProcessorId, TRIM_Processor.Name, TRIM_Card.Product, that i need to print as friendly name, since this is to show to not technical staff – Agus Mar 14 '12 at 15:57
  • i think the best approach could the explain at http://stackoverflow.com/questions/63447/how-do-you-perform-an-if-then-in-an-sql-select – Agus Mar 14 '12 at 17:03