January 18, 2011 at 7:04 am
create table hp
(id int,
name varchar(30))
insert into hp values (1,'HP')
insert into hp values (2,'HP')
HP1
HP2
Actually i want value like HP ,1, 2 (one row rather than 2 rows)
Can anyone let me know how can i get that?
January 18, 2011 at 7:32 am
select name, min(id) , max(id)
from hp
group by name
January 18, 2011 at 9:20 am
Did you see this article?[/url]
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
January 21, 2011 at 1:07 am
Plesae use this.
SELECT name, ID, COUNT(*) as CNT
FROM hp
Group by name, ID
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply