Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
sagavb
Starting Member
18 Posts |
Posted - 2009-05-29 : 05:43:34
|
Hi friends,I am new to SQL. Can anyone help on this?Table name: testname patha 'C:'b 'D:'c 'E:'a 'D:'c 'F:'In the above table, a and c values are repeated.I just want to find out the first occurences of the path for duplicate valuesoutput must be as mentioned below;-----------------------------------name patha 'C:'c 'E:'RegardsSaga |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-05-29 : 05:45:32
|
[code]select name, min(path)from yourtablegroup by namehaving count(*) > 1[/code] KH[spoiler]Time is always against us[/spoiler] |
|
|
sagavb
Starting Member
18 Posts |
Posted - 2009-05-29 : 05:46:58
|
Thanks a lotquote: Originally posted by khtan
select name, min(path)from yourtablegroup by namehaving count(*) > 1 KH[spoiler]Time is always against us[/spoiler]
|
|
|
sagavb
Starting Member
18 Posts |
Posted - 2009-05-29 : 05:52:58
|
Hi,Table name: testname patha 'C:'b 'D:'c 'E:'a 'D:'c 'F:'In the above table, a and c values are repeated.I just want to delete the repeated rows without using group by clauseoutput must be as mentioned below;-----------------------------------name pathb 'D:'RegardsSaga |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-05-29 : 05:55:51
|
Why the restriction of NOT using the GROUP BY statement?Is this homework question? E 12°55'05.63"N 56°04'39.26" |
|
|
sagavb
Starting Member
18 Posts |
Posted - 2009-05-29 : 05:56:34
|
Yes.But, is this possible?quote: Originally posted by Peso Why the restriction of NOT using the GROUP BY statement?Is this homework question? E 12°55'05.63"N 56°04'39.26"
|
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-05-29 : 05:59:00
|
Yes, but will be more difficult and involves loops and things.Let me talk to your professor E 12°55'05.63"N 56°04'39.26" |
|
|
|
|
|