Loading ...
Sorry, an error occurred while loading the content.

Select top 10 records

Expand Messages
  • darravian
    Hi, I want to select the top 10 records from my database, how it can be happen. I am using the following query: but it is not working. Select top 10
    Message 1 of 6 , May 2, 2005
    • 0 Attachment
      Hi,

      I want to select the top 10 records from my database, how it can be
      happen.

      I am using the following query: but it is not working.

      "Select top 10 News_Headlie From tbl_News"

      bye

      DAR
    • Arindam
      Ur query is corrent , it should work darravian wrote: Hi, I want to select the top 10 records from my database, how it can be happen. I
      Message 2 of 6 , May 2, 2005
      • 0 Attachment
        Ur query is corrent ,
        it should work

        darravian <darravian@...> wrote:
        Hi,

        I want to select the top 10 records from my database, how it can be
        happen.

        I am using the following query: but it is not working.

        "Select top 10  News_Headlie From tbl_News"

        bye

        DAR








        Thanks & Regards

        Arindam
        Web Designer & Developer
         

        Yahoo! India Matrimony: Find your life partner online.

      • brigette1008
        If you just want to pull the top 10 News_Headlie from the table tbl_News then your query is correct and should work. But if you want to pull the top 10 records
        Message 3 of 6 , May 2, 2005
        • 0 Attachment
          If you just want to pull the top 10 News_Headlie from the table
          tbl_News then your query is correct and should work.
          But if you want to pull the top 10 records (assuming you have more
          than one column in your table)then
          "select top 10 * from tbl_News" will do it.
          If you want the top 10 depending on a certain criteria(for example
          descending totals) then this will do it:

          "select top 10 * from tbl_News
          group by totals desc"

          Hope this helps





          --- In SQLQueriesNoCode@yahoogroups.com, Arindam <e_arindam@y...>
          wrote:
          > Ur query is corrent ,
          > it should work
          >
          > darravian <darravian@y...> wrote:
          > Hi,
          >
          > I want to select the top 10 records from my database, how it can
          be
          > happen.
          >
          > I am using the following query: but it is not working.
          >
          > "Select top 10 News_Headlie From tbl_News"
          >
          > bye
          >
          > DAR
          >
          >
          >
          >
          >
          >
          >
          >
          > ---------------------------------
          > Yahoo! Groups Links
          >
          > To visit your group on the web, go to:
          > http://groups.yahoo.com/group/SQLQueriesNoCode/
          >
          > To unsubscribe from this group, send an email to:
          > SQLQueriesNoCode-unsubscribe@yahoogroups.com
          >
          > Your use of Yahoo! Groups is subject to the Yahoo! Terms of
          Service.
          >
          >
          >
          >
          > Thanks & Regards
          >
          > Arindam
          > Web Designer & Developer
          >
          >
          >
          >
          > Yahoo! India Matrimony: Find your life partneronline.
        • waseem kiyani
          Hii.. i got ur problem. here is the solution assuming that your database is Oracle. Select News_Headlie from ( Select News_Headlie from tbl_News order by
          Message 4 of 6 , May 3, 2005
          • 0 Attachment
            Hii.. i got ur problem. here is the solution assuming that your database is Oracle.
             
            Select News_Headlie from ( Select News_Headlie from tbl_News
                              order by News_Headlie desc) where rownum<=10;

             

            I guarantee u that it will work for u.


            brigette1008 <brigette1008@...> wrote:

            If you just want to pull the top 10 News_Headlie from the table
            tbl_News then your query is correct and should work.
            But if you want to pull the top 10 records (assuming you have more
            than one column in your table)then
            "select top 10 * from tbl_News" will do it.
            If you want the top 10 depending on a certain criteria(for example
            descending totals) then this will do it:

            "select top 10 * from tbl_News
            group by totals desc"

            Hope this helps





            --- In SQLQueriesNoCode@yahoogroups.com, Arindam <e_arindam@y...>
            wrote:
            > Ur query is corrent ,
            > it should work
            >
            > darravian <darravian@y...> wrote:
            > Hi,
            >
            > I want to select the top 10 records from my database, how it can
            be
            > happen.
            >
            > I am using the following query: but it is not working.
            >
            > "Select top 10  News_Headlie From tbl_News"
            >
            > bye
            >
            > DAR
            >
            >
            >
            >
            >
            >
            >
            >
            > ---------------------------------
            > Yahoo! Groups Links
            >
            >    To visit your group on the web, go to:
            > http://groups.yahoo.com/group/SQLQueriesNoCode/
            >  
            >    To unsubscribe from this group, send an email to:
            > SQLQueriesNoCode-unsubscribe@yahoogroups.com
            >  
            >    Your use of Yahoo! Groups is subject to the Yahoo! Terms of
            Service.
            >
            >
            >
            >
            > Thanks & Regards
            >
            > Arindam
            > Web Designer & Developer 
            >
            >
            >
            >
            > Yahoo! India Matrimony: Find your life partneronline.








            Yahoo! Groups Links

            __________________________________________________
            Do You Yahoo!?
            Tired of spam? Yahoo! Mail has the best spam protection around
            http://mail.yahoo.com

          • chas_long2002
            When you say it is not working , what do you mean exactly? Are you getting an error? If so, with what code and mesage? Or are you getting results, but not
            Message 5 of 6 , May 3, 2005
            • 0 Attachment
              When you say 'it is not working', what do you mean exactly? Are you
              getting an error? If so, with what code and mesage? Or are you getting
              results, but not those which you expected? If the latter, what was
              wanted and what received?


              --- In SQLQueriesNoCode@yahoogroups.com, "darravian" <darravian@y...>
              wrote:
              > Hi,
              >
              > I want to select the top 10 records from my database, how it can be
              > happen.
              >
              > I am using the following query: but it is not working.
              >
              > "Select top 10 News_Headlie From tbl_News"
              >
              > bye
              >
              > DAR
            • faisal dar
              Thanks a Lot to all of you. It was my spelling mistake. the query was right. once again I am thankful to you. bye DAR ...
              Message 6 of 6 , May 4, 2005
              • 0 Attachment
                Thanks a Lot to all of you.

                It was my spelling mistake.

                the query was right.

                once again I am thankful to you.

                bye

                DAR
                --- waseem kiyani <waseem_arid@...> wrote:
                > Hii.. i got ur problem. here is the solution
                > assuming that your database is Oracle.
                >
                > Select News_Headlie from ( Select News_Headlie from
                > tbl_News
                > order by News_Headlie desc) where
                > rownum<=10;
                >
                >
                >
                > I guarantee u that it will work for u.
                >
                > brigette1008 <brigette1008@...> wrote:
                >
                > If you just want to pull the top 10 News_Headlie
                > from the table
                > tbl_News then your query is correct and should work.
                >
                > But if you want to pull the top 10 records (assuming
                > you have more
                > than one column in your table)then
                > "select top 10 * from tbl_News" will do it.
                > If you want the top 10 depending on a certain
                > criteria(for example
                > descending totals) then this will do it:
                >
                > "select top 10 * from tbl_News
                > group by totals desc"
                >
                > Hope this helps
                >
                >
                >
                >
                >
                > --- In SQLQueriesNoCode@yahoogroups.com, Arindam
                > <e_arindam@y...>
                > wrote:
                > > Ur query is corrent ,
                > > it should work
                > >
                > > darravian <darravian@y...> wrote:
                > > Hi,
                > >
                > > I want to select the top 10 records from my
                > database, how it can
                > be
                > > happen.
                > >
                > > I am using the following query: but it is not
                > working.
                > >
                > > "Select top 10 News_Headlie From tbl_News"
                > >
                > > bye
                > >
                > > DAR
                > >
                > >
                > >
                > >
                > >
                > >
                > >
                > >
                > > ---------------------------------
                > > Yahoo! Groups Links
                > >
                > > To visit your group on the web, go to:
                > > http://groups.yahoo.com/group/SQLQueriesNoCode/
                > >
                > > To unsubscribe from this group, send an email
                > to:
                > > SQLQueriesNoCode-unsubscribe@yahoogroups.com
                > >
                > > Your use of Yahoo! Groups is subject to the
                > Yahoo! Terms of
                > Service.
                > >
                > >
                > >
                > >
                > > Thanks & Regards
                > >
                > > Arindam
                > > Web Designer & Developer
                > >
                > >
                > >
                > >
                > > Yahoo! India Matrimony: Find your life
                > partneronline.
                >
                >
                >
                >
                >
                >
                >
                >
                > ---------------------------------
                > Yahoo! Groups Links
                >
                > To visit your group on the web, go to:
                > http://groups.yahoo.com/group/SQLQueriesNoCode/
                >
                > To unsubscribe from this group, send an email to:
                > SQLQueriesNoCode-unsubscribe@yahoogroups.com
                >
                > Your use of Yahoo! Groups is subject to the
                > Yahoo! Terms of Service.
                >
                >
                >
                > __________________________________________________
                > Do You Yahoo!?
                > Tired of spam? Yahoo! Mail has the best spam
                > protection around
                > http://mail.yahoo.com

                __________________________________________________
                Do You Yahoo!?
                Tired of spam? Yahoo! Mail has the best spam protection around
                http://mail.yahoo.com
              Your message has been successfully submitted and would be delivered to recipients shortly.