Re: order by Desc,third data

Tech-Archive recommends: Speed Up your PC by fixing your registry



This should be very fast if you have the right indexes. Do you have an
index on Month?

--
Andrew J. Kelly SQL MVP


"Sam_Chou" <SamChou@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:75531889-BD27-4AAF-AA1B-86A081FF1B54@xxxxxxxxxxxxxxxx
> in sql
> I use "select top 3 from......order by (tablename) desc,that can give 3
> datas
> but i want third data to my program
> So i use other function:
>
> SELECT TOP 1 'answer'=AAA.A FROM
> (
> select distinct top 3 'A'=month FROM dataTable
> where month < '200511'
> ORDER BY month DESC
> ) as AAA
> ORDER BY AAA.A
>
> But ,how can i do fast?
> Can use other function?


.



Relevant Pages

  • Re: order by Desc,third data
    ... by month on a regular basis then you need an index on that column. ... >> Andrew J. Kelly SQL MVP ... >>> but i want third data to my program ...
    (microsoft.public.sqlserver.clients)
  • Re: SQL2005 Mgt Studio - script DROP before CREATE?
    ... until SP1 for that. ... Andrew J. Kelly SQL MVP ... Prev by Date: ...
    (microsoft.public.sqlserver.tools)
  • Re: Question about BPA
    ... I believe as long as you can point it to the server you are all set. ... Andrew J. Kelly SQL MVP ... Prev by Date: ...
    (microsoft.public.sqlserver.tools)
  • Re: connection to another server
    ... to accomplish? ... Andrew J. Kelly SQL MVP ... Prev by Date: ...
    (microsoft.public.sqlserver.connect)
  • Re: $50 2005 SQL ?
    ... Until then you can download it for ... Andrew J. Kelly SQL MVP ... Prev by Date: ...
    (microsoft.public.sqlserver.tools)