| Author |
Topic |
|
BankOfficerHere
Posting Yak Master
124 Posts |
Posted - 2009-03-31 : 18:58:00
|
| I have a statement that shows like this: SELECT TOP 1 symptom,ResolutionID, ResolutionTitle, PhoneBrand,ResolutionDetails1, case when (resolution_A)*1.0 = '0' then '0' else (resolution)*1.0/(resolution_A) *1.0 end AS RFR FROM dbo.GlobeKB_KMT3It has more than 10 results. Is it possible to show only the the 7th row? thanks |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
BankOfficerHere
Posting Yak Master
124 Posts |
Posted - 2009-03-31 : 21:43:59
|
| I'm only using 2000. Would that still possible? |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2009-03-31 : 21:47:16
|
| Unfortunately no, but you could try this:http://www.sqlteam.com/article/whats-after-top |
 |
|
|
BankOfficerHere
Posting Yak Master
124 Posts |
Posted - 2009-04-01 : 03:09:34
|
| it's not working..is it possible to just get the 7th row only? |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-04-01 : 03:58:28
|
quote: Originally posted by BankOfficerHere it's not working..is it possible to just get the 7th row only?
Show us the code that is not workingMadhivananFailing to plan is Planning to fail |
 |
|
|
BankOfficerHere
Posting Yak Master
124 Posts |
Posted - 2009-04-01 : 04:10:14
|
| SELECT TOP 1 symptom,ResolutionID, ResolutionTitle, PhoneBrand,ResolutionDetails1, case when (resolution_A)*1.0 = '0' then '0' else (resolution)*1.0/(resolution_A) *1.0 end AS RFR FROM dbo.GlobeKB_KMT3I just want to show row 7 alone |
 |
|
|
ashishashish
Constraint Violating Yak Guru
408 Posts |
Posted - 2009-04-01 : 04:28:46
|
| on which basis u divide rows mean on which basis u divide 7 row....but like that ..may be select top 1 from (select top 7 from .. order by urcolumn desc)t order by urfield descMay Be this gonna solve ur ProblemThanks... |
 |
|
|
BankOfficerHere
Posting Yak Master
124 Posts |
Posted - 2009-04-01 : 05:01:42
|
| i tried that but i think Dreamweaver does not accept Top1 |
 |
|
|
ashishashish
Constraint Violating Yak Guru
408 Posts |
Posted - 2009-04-01 : 07:36:25
|
| u jus do it in your sql ... |
 |
|
|
BankOfficerHere
Posting Yak Master
124 Posts |
Posted - 2009-04-01 : 07:37:52
|
| it's there another way? |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2009-04-01 : 07:42:07
|
| Not really, this is the simplest way to do it in SQL 2000.May I ask what's so important about the 7th row? Also, why are you using Dreamweaver? If Dreamweaver does not support this syntax you can create a stored procedure with the correct SQL and then execute that stored procedure. |
 |
|
|
BankOfficerHere
Posting Yak Master
124 Posts |
Posted - 2009-04-01 : 07:44:13
|
| yeah it's important |
 |
|
|
ashishashish
Constraint Violating Yak Guru
408 Posts |
Posted - 2009-04-01 : 07:45:35
|
| Yes this The Best Way to do this,,, fo r u r working in Dream Viewer than Jus make A Store Procedure of that thing and Just call that procedure from your application and this procedure u also able to choose that which row u want exactly by a little bit of modification....So just prepare a procedure for that purpose,,,Thanks... |
 |
|
|
|