Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select with Case
Message
De
08/10/2007 15:25:19
Issam Mansour
Jordan Business Machines
Amman, Jordanie
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Select with Case
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01259547
Message ID:
01259547
Vues:
54
This is my first time using case statement; I am tried to case the value of a field on a select statement as follows:

SELECT #f.catcode,
#f.subcode,
'' AS sercode,
'' AS ITEMNO,
CASE LEN(#f.SubCode)
WHEN 0 THEN #f.CatCode
ELSE #f.CatCode + #f.SubCode
END AS ITEM_NO,
CASE LEN(#f.SubCode)
WHEN 0 THEN ''
ELSE #f.SubCode
END AS FATHER,
CASE LEN(#f.SubCode)
WHEN 0 THEN category.catdesc
ELSE category.catdesc
END AS ITEMDESC,
'' AS UNIT,
0 AS PIECES,
0 AS qoh,
0 as lastone
into #cur1
FROM #f inner join category on #f.catcode = category.catcode or #f.subcode = category.subcode

I have an error message as follows:
Invalid object name 'category'.

Can anyone help me with this?

Best Regards
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform