Viewing 5 posts - 1 through 5 (of 5 total)
It's not the same. The expected output is different in this case thats why.
Table structure is also different. Hence posted as a new question.
December 2, 2024 at 7:32 pm
Thanks for the response.
December 2, 2024 at 7:23 pm
DROP TABLE IF EXISTS #tblItems;
CREATE TABLE #tblItems (Rownr INT NULL, ItemID int NULL, Status nvarchar(50) NULL , StatusDate smalldatetime NULL)
INSERT INTO #tblItems
(
Rownr, ItemID , Status , StatusDate
)
VALUES
(1,101,'QualityCheck','15-01-2024 07:02:00'),
(2,101,'Printing','15-01-2024 10:20:00'),
(3,101,'Labelling','15-01-2024 15:30:00'),
(4,101,'Packing','16-01-2024...
September 28, 2024 at 12:37 pm
the below query is another way which gives the desired output but this is also a workaround.
select top 1 s.studentid, s.name, sum(marks)
from tbl_marks m inner join tbl_student s
on m.studentid=s.studentid
group by...
January 18, 2013 at 12:27 am
the below query works and i get the desired o/p but i dont think it is an efficient way.
select s.StudentID, s.name, sum(marks)
from tbl_marks m inner join tbl_student s
on m.studentid=s.studentid
group...
January 18, 2013 at 12:20 am
Viewing 5 posts - 1 through 5 (of 5 total)