Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
sql server counts of columns
Hari Shanker
Dec 20 2016 2:22 AM
252
Reply
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
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
insert query with 10 records at at a time
Showing error Invalid object name 'INFORMATION_SCHEMA.COLUM'