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
Hari Shanker
NA
260
34k
sql server counts of columns
Dec 20 2016 2:22 AM
Hi,
select count(*) from table1 where inventoryid = 21 -- 132
select count([expired]) from table1 where inventoryid = 21 and [expired] = 1 -- 57
select count([Consigmment]) from table1 where inventoryid = 21 and [expired] = 1 -- 54
·
I need the results as in below screenshot - with a single query
InventoryId
Counts
Expired
Consigmnet
21
132
57
54
Regards,
hari
Reply
Answers (
1
)
insert query with 10 records at at a time
Showing error Invalid object name 'INFORMATION_SCHEMA.COLUM'