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 |
|
crishna
Starting Member
5 Posts |
Posted - 2008-10-29 : 13:00:09
|
| Hi,Row Column LabelText TextBoxLabelText CheckBoxText FormCellTypeF7A8AE42 9C790FB2 Command and Display LabelF7A8AE42 B34B7D87 Command and Display Label88CC0121 9C790FB2 Date: TextField88CC0121 B34B7D87 Date: TextFieldEDE01A0E 9C790FB2 Job Name TextFieldEDE01A0E B34B7D87 Job Name TextFieldGHFFGRYT HJRTYEt6 testSample CheckBoxGHFFGRYT HJRTYUER testSample CheckBoxI am searching how to write a query to get below dataRow Column LabelText TextBoxLabelText CheckBoxText FormCellTypeF7A8AE42 9C790FB2 Command and Display Label88CC0121 9C790FB2 Date: TextFieldEDE01A0E 9C790FB2 Job Name TextFieldGHFFGRYT HJRTYEt6 testSample CheckBoxHow can I arrive at Distict rows when there are rows with repeating text in last 4 Columns |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-29 : 13:05:25
|
| [code]SELECT *FROM(SELECT ROW_NUMBER() OVER(PARTITION BY Row ORDER BY Column) AS Seq,*FROM Table)tWHERE Seq=1[/code] |
 |
|
|
crishna
Starting Member
5 Posts |
Posted - 2008-10-29 : 14:02:20
|
| hey thanks for the reply,SELECT * FROM( SELECT ROW_NUMBER() OVER(PARTITION BY Row ORDER BY Column) AS Seq,* FROM #celltmp) WHERE Seq=1)it gives me a error. Could you please tell me where I am doing wrong |
 |
|
|
hanbingl
Aged Yak Warrior
652 Posts |
Posted - 2008-10-29 : 14:09:45
|
| missing alias your table name "t", just copy exactly what visakh16 posted.Make sure that you are using sql 2005 or later |
 |
|
|
crishna
Starting Member
5 Posts |
Posted - 2008-10-29 : 14:24:18
|
works like a charm.thanks guys |
 |
|
|
|
|
|