ถ้าใช้คำสั่งนี้
SELECT c.CaseNo, Status=us.KName, CaseType=uc.KName
FROM Case c
LEFT JOIN LookupTable us ON us.KVal=c.iStatus
AND us.KGroup=1
LEFT JOIN LookupTable uc ON uc.KVal=c.iCaseType
AND uc.KGroup=2
จะได้ข้อมูลดังนี้
CaseNo Status CaseType
53-001 Open Hardware
53-002 Closed Software
53-003 Open
Tag : .NET, Ms SQL Server 2005, Crystal Report, Win (Windows App), VS 2005 (.NET 2.x)