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 |
|
iceman_23
Starting Member
6 Posts |
Posted - 2008-05-20 : 21:24:05
|
| My scenario is:I got this ReportItems.Value which is an Integer lets name it Value1.I got this rowcount and lets name is Value2.Can you help me generate a query wherein:1.Value1 = Value2 2. And the Row from Value2 and its succeeding Rows be deleted or be hiden.ic3m@n |
|
|
dshelton
Yak Posting Veteran
73 Posts |
Posted - 2008-05-20 : 22:16:54
|
| One option could be to use a CTE with the ROW_NUMBER() function and necessary ordering.You can then select rows with RowNumber < Value1 David |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-21 : 00:13:03
|
quote: Originally posted by iceman_23 My scenario is:I got this ReportItems.Value which is an Integer lets name it Value1.I got this rowcount and lets name is Value2.Can you help me generate a query wherein:1.Value1 = Value2 2. And the Row from Value2 and its succeeding Rows be deleted or be hiden.ic3m@n
Didnt understand why you are trying to do this. can you explain? |
 |
|
|
iceman_23
Starting Member
6 Posts |
Posted - 2008-05-21 : 01:58:14
|
| Im currently computing for a rate of some data and 2% out of the 98% from the rate should not be visible to users.having to ask me that it seems you know something = ) to solve my problem.ic3m@n |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-21 : 02:15:23
|
quote: Originally posted by iceman_23 Im currently computing for a rate of some data and 2% out of the 98% from the rate should not be visible to users.having to ask me that it seems you know something = ) to solve my problem.ic3m@n
So if you have 100 rows you need to show only 98 rows & hide 2 rows? |
 |
|
|
iceman_23
Starting Member
6 Posts |
Posted - 2008-05-21 : 03:40:58
|
| Thats correct. Im currently dealing with a handful of data not just by hundreds.ic3m@n |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-21 : 03:49:30
|
quote: Originally posted by iceman_23 Thats correct. Im currently dealing with a handful of data not just by hundreds.ic3m@n
I think its better to bring them from db along with RowNumber and do filter in reports such that RowNumber <=98 |
 |
|
|
|
|
|