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
Ankit Shukla
NA
681
116.8k
join query with default value, if no match
Jul 31 2019 6:04 AM
Hello All,
Suppose I have 2 tables:
Table1:
Status_CD | Status
---------------------------
1 | A
2 | B
Table2:
SNo | Status_CD
---------------------------
1 | 1
1 | 2
2 | 1
Need count of Status as per SNo And Output should be this:
SNo | Status | Counts
---------------------------------
1 | A | 1
1 | B | 1
2 | A | 1
2 | B | 0
How can I get this output (Row 4). If there is no matching then gives 0 by default?
Thanks in advance.
Reply
Answers (
2
)
Report req Sum of Sales order qty and daily produce quantity
Stored Procedure