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

SQL Tips & Tricks Issue #9 [HTML]

Expand Messages
  • Anjana Ram
    Usage of operators The speed of the query also depends on the operators used in the where clause. Key operators used in the WHERE clause, ordered by their
    Message 1 of 11 , Apr 7, 2004
    • 0 Attachment
      Usage of operators

      The speed of the query also depends on the operators used in the
      where clause. Key operators used in the WHERE clause, ordered by
      their performance (descending order of performance)are

      = (highest performance)

      >, >=, <, <=

      LIKE

      <> (lowest performance)

      So, try to manage writing your queries by using = operators and
      minimize the use of <>.

      Regards
      Anjana
      MS India Community Star
      MUGH.NET
    • aneesh
      Hi I got a problem I have the following table structure x y z ... 30 1 qwq 30 2 err 30 3 yu 31 1 t 31 2 yy and i need to display the items having Max(y) i.e.
      Message 2 of 11 , Apr 9, 2004
      • 0 Attachment
        Hi
        I got a problem
        I have the following table structure

        x y z
        ------------------
        30 1 qwq
        30 2 err
        30 3 yu
        31 1 t
        31 2 yy

        and i need to display the items having Max(y)

        i.e.

        x y z
        ------------------
        30 3 yu
        31 2 yy

        regards
        Aneesh

        __________________________________
        Do you Yahoo!?
        Yahoo! Small Business $15K Web Design Giveaway
        http://promotions.yahoo.com/design_giveaway/
      • Anjana Ram
        Hi I think you are asking for all Y values with their Max(X). That s what I understand from the resultset you have displayed. Try this query select * from test
        Message 3 of 11 , Apr 9, 2004
        • 0 Attachment
          Hi

          I think you are asking for all Y values with their Max(X).
          That's what I understand from the resultset you have displayed.

          Try this query

          select * from test A where x=(select max(x) from test where y=a.y)

          Regards
          Anjana
          MS India Commumity Star
          MUGH.NET

          --- In sqlcon@yahoogroups.com, aneesh <aneeshattingal@y...> wrote:
          > Hi
          > I got a problem
          > I have the following table structure
          >
          > x y z
          > ------------------
          > 30 1 qwq
          > 30 2 err
          > 30 3 yu
          > 31 1 t
          > 31 2 yy
          >
          > and i need to display the items having Max(y)
          >
          > i.e.
          >
          > x y z
          > ------------------
          > 30 3 yu
          > 31 2 yy
          >
          > regards
          > Aneesh
          >
          > __________________________________
          > Do you Yahoo!?
          > Yahoo! Small Business $15K Web Design Giveaway
          > http://promotions.yahoo.com/design_giveaway/
        • Anjana Ram
          Hi, I think I had understood you requirement wrong last time. I believe you want display max(y) values for all distinct x. Hope I have understood your
          Message 4 of 11 , Apr 10, 2004
          • 0 Attachment
            Hi,

            I think I had understood you requirement wrong last time.
            I believe you want display max(y) values for all distinct x.

            Hope I have understood your requirement right.

            So try this:

            select * from test A where y=(select max(y) from test where x=a.x )
            order by y desc

            It will give you
            X Y Z
            ------------------
            30 3 yu
            31 2 yy


            The previous query will give you max(x) values for all Y values.



            Regards
            Anjana
            MS India Community Star
            MUGh.NET


            --- In sqlcon@yahoogroups.com, "Anjana Ram" <anjana_r21@y...> wrote:
            > Hi
            >
            > I think you are asking for all Y values with their Max(X).
            > That's what I understand from the resultset you have displayed.
            >
            > Try this query
            >
            > select * from test A where x=(select max(x) from test where y=a.y)
            >
            > Regards
            > Anjana
            > MS India Commumity Star
            > MUGH.NET
            >
            > --- In sqlcon@yahoogroups.com, aneesh <aneeshattingal@y...> wrote:
            > > Hi
            > > I got a problem
            > > I have the following table structure
            > >
            > > x y z
            > > ------------------
            > > 30 1 qwq
            > > 30 2 err
            > > 30 3 yu
            > > 31 1 t
            > > 31 2 yy
            > >
            > > and i need to display the items having Max(y)
            > >
            > > i.e.
            > >
            > > x y z
            > > ------------------
            > > 30 3 yu
            > > 31 2 yy
            > >
            > > regards
            > > Aneesh
            > >
            > > __________________________________
            > > Do you Yahoo!?
            > > Yahoo! Small Business $15K Web Design Giveaway
            > > http://promotions.yahoo.com/design_giveaway/
          • Karthikeyan
            Hi , When i run a stored proc with xml input i am getting an error by what command i can see the error message. Thanks & Regards Karthikeyan ... Do you Yahoo!?
            Message 5 of 11 , Apr 12, 2004
            • 0 Attachment

              Hi ,

              When i run a stored proc with xml input i am getting an error by what command i can see the error message.

               



              Thanks & Regards
               
              Karthikeyan
               


              Do you Yahoo!?
              Yahoo! Small Business $15K Web Design Giveaway - Enter today
            • veer wangoo
              what sort of error are you gettg and R u using any XSP(xtended stored Procs) are using to input the XML file data...R u validating the XML data in Data
              Message 6 of 11 , Apr 13, 2004
              • 0 Attachment
                what sort of error are you gettg
                and R u using any XSP(xtended stored Procs) are using
                to input the XML file data...R u validating the XML
                data in Data layer Or in middle tier code...

                PLease give some more details so that we can help on
                that..



                --- Karthikeyan <r_karthikeyan_2000@...> wrote:
                >
                > Hi ,
                >
                > When i run a stored proc with xml input i am getting
                > an error by what command i can see the error
                > message.
                >
                >
                >
                >
                > Thanks & Regards
                >
                > Karthikeyan
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                > ---------------------------------
                > Do you Yahoo!?
                > Yahoo! Small Business $15K Web Design Giveaway -
                > Enter today


                =====

                VEER JI WANGOO
                DBA - Support
                Microsoft BUIT (HYD)
                INDIA
                MOBILE:-+91-41-32380755

                LANDLINE:-011-26645334
                ALTERNATE MAIL ID:-v-veerjw@...













                __________________________________
                Do you Yahoo!?
                Yahoo! Small Business $15K Web Design Giveaway
                http://promotions.yahoo.com/design_giveaway/
              • veer
                Hey Karthikeyan.... I am still waiting for the inputs from you.. IN the mean time, please check out the April issue of tech capsule brought out by MUGH ..there
                Message 7 of 11 , Apr 13, 2004
                • 0 Attachment
                  Hey Karthikeyan....

                  I am still waiting for the inputs from you..

                  IN the mean time, please check out the April issue of tech capsule
                  brought out by MUGH ..there is a cool article on XML features of
                  SQL2000.. http://www.mugh.net/mtc/ or check at http://mugh.net/sql


                  Still send me the inputs as asked by me in last mail ....Other s can
                  also dig in more with those details...

                  Regards



                  --- In sqlcon@yahoogroups.com, Karthikeyan <r_karthikeyan_2000@y...>
                  wrote:
                  >
                  > Hi ,
                  >
                  > When i run a stored proc with xml input i am getting an error by
                  what command i can see the error message.
                  >
                  >
                  >
                  >
                  > Thanks & Regards
                  >
                  > Karthikeyan
                  >
                  >
                  >
                  >
                  >
                  >
                  >
                  >
                  >
                  >
                  >
                  > ---------------------------------
                  > Do you Yahoo!?
                  > Yahoo! Small Business $15K Web Design Giveaway - Enter today
                • madushala
                  I need Help. Please help me ... Start your day with Yahoo! - make it your home page
                  Message 8 of 11 , Aug 2, 2005
                  • 0 Attachment
                  • Santhosh
                    help on what? if that is too urgent then press F1 ... ____________________________________________________ Start your day with Yahoo! - make it your home page
                    Message 9 of 11 , Aug 2, 2005
                    • 0 Attachment
                      help on what? if that is too urgent then press F1

                      --- madushala <madushaladream@...> wrote:

                      > I need Help. Please help me
                      >
                      >
                      > ---------------------------------
                      > Start your day with Yahoo! - make it your home page





                      ____________________________________________________
                      Start your day with Yahoo! - make it your home page
                      http://www.yahoo.com/r/hs
                    • rakesh dhar
                      Hi Friends, Please help me for this Question . How may Tables can we use in a Join (any Join Inner,Outer,Left.....) in SQL 2005. 10,20,50.......300 Tables ...?
                      Message 10 of 11 , Jul 20, 2010
                      • 0 Attachment
                        Hi Friends,

                        Please help me for this Question .
                        How may Tables can we use in a Join (any Join Inner,Outer,Left.....)
                        in SQL 2005.

                        10,20,50.......300 Tables ...? How many Tables .... Please help


                        Regds
                        Rakesh Dhar










                        [Non-text portions of this message have been removed]
                      • Nithin Mohan T K
                        There is no limitation as far as I know. Any number you prefer you can use, the more the join, the slower the fetching of data. From: sqlcon@yahoogroups.com
                        Message 11 of 11 , Jul 20, 2010
                        • 0 Attachment
                          There is no limitation as far as I know. Any number you prefer you can use,
                          the more the join, the slower the fetching of data.









                          From: sqlcon@yahoogroups.com [mailto:sqlcon@yahoogroups.com] On Behalf Of
                          rakesh dhar
                          Sent: Tuesday, July 20, 2010 1:59 PM
                          To: sqlcon@yahoogroups.com
                          Subject: MUGH-SQLCON Help





                          Hi Friends,

                          Please help me for this Question .
                          How may Tables can we use in a Join (any Join Inner,Outer,Left.....)
                          in SQL 2005.

                          10,20,50.......300 Tables ...? How many Tables .... Please help

                          Regds
                          Rakesh Dhar

                          [Non-text portions of this message have been removed]





                          [Non-text portions of this message have been removed]
                        Your message has been successfully submitted and would be delivered to recipients shortly.