TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Pinku
1.4k
308
46.6k
How to use case condition in sql server
Aug 9 2019 12:55 AM
select AccountDID,Productslice,Productcount,LCSCount from (select coalesce (a.AccountDID,b.AccountDID) as AccountDID,a.ProductSlice,
sum(isnull(a.ProductCount,0)) ProductCount,sum(isnull(b.LCSCount,0)) LCSCount,b.RdbSliceCode from #ProductAudit a
full outer join #LCSAudit b on a.AccountDID=b.AccountDID and a.ProductSlice=b.RdbSliceCode
group by a.AccountDID,b.AccountDID,a.ProductSlice,b.RdbSliceCode)a where LCSCount<>ProductCount
here #ProductAudit table contain one column i.e levelCapability and #LCSAudit contain one column i.e usergroupname
So i want to use case in above query like..the condition is..
if in #ProductAudit table ...levelCapability =="recruitment" and in #LCSAudit table ..... usergroupname==null than i want to select the account did..
How can i do it?
Reply
Answers (
3
)
Why index REBUILD does not reduce index fragmentation?
Primary key column number bounced in sql