![]() |
if dentro de un case holas... me gustaria saber si se puede inkluir un if dentro de un case en sql, porke tengo el siguiente kodigo de un procedimiento y me da error de sintaxis.. Código: case descrip_form.tipo |
Hola, no puedes incluir el if en ese lugar; pero en lugar de usar ese if puedes usar otro case: case descrip_form.tipo when 't' then convert(nvarchar(4000),isnull(valor_hist.v_t,'--')) when 's' then convert(nvarchar(800),isnull(valor_hist.v_t,'--')) when 'c' then case when (select cod_ubic from valor_hist where cod_ubic = @cod_ubic and cod_campo = '4263') is not null then set @var='s' select @var as mercado else set @var='n' select @var as mercado end when 'm' then convert(nvarchar(4000),isnull(valor_hist.v_m,'--')) when 'n' then convert(nvarchar(200),convert(int,isnull(valor_his t.v_n,'0'))) when 'f' then convert(nvarchar(10),isnull(valor_hist.v_f,null) ,103) when 'e' then 'Titulo' else '--' end as valor |
ok muuuuuuuuxaaas.. gracias por tu ayuda. :adios: |
| La zona horaria es GMT -6. Ahora son las 19:39. |
Desarrollado por vBulletin® Versión 3.8.7
Derechos de Autor ©2000 - 2026, Jelsoft Enterprises Ltd.