Howto use if or case in SQL Server 2008 -
i new sql server , trying search cds or dvds through name , type(cd/dvd).
if not solved, show amount cds or dvds, have in stock.
declare @typ varchar set @name = 'kil' set @typ = 'dvd' if (@typ 'dvd') begin select titul.name titul titul_id in ( select titul_id dvd titul_id in ( select titul_id titul titul.name @name+'%' ) , (dvd.solddate null) ) group titul.name end
but first step (if dvd..) not work.
Comments
Post a Comment