ordering mysql request by part of a key

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bill

    ordering mysql request by part of a key

    I have a database of kennels. One page lists the kennels
    alphabetically by kennel name.
    I have a field for kennel name and an index with kennel name as
    the only field.

    Some of the kennels have the word "The" as the first word in the
    name and they do not want to be listed alphabetically by "The..."

    Is there a way that I can request that mysql ignore "The" in a
    kennel name when ordering it or must I create a new field for the
    ordering and remove the "The" from the kennel name for that field ?

    bill
  • Jerry Stuckle

    #2
    Re: ordering mysql request by part of a key

    bill wrote:
    I have a database of kennels. One page lists the kennels alphabetically
    by kennel name.
    I have a field for kennel name and an index with kennel name as the only
    field.
    >
    Some of the kennels have the word "The" as the first word in the name
    and they do not want to be listed alphabetically by "The..."
    >
    Is there a way that I can request that mysql ignore "The" in a kennel
    name when ordering it or must I create a new field for the ordering and
    remove the "The" from the kennel name for that field ?
    >
    bill
    comp.databases. mysql would be a much better place to ask this question.

    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    • bill

      #3
      Re: ordering mysql request by part of a key

      Jerry Stuckle wrote:
      bill wrote:
      >I have a database of kennels. One page lists the kennels
      >alphabetical ly by kennel name.
      >I have a field for kennel name and an index with kennel name as the
      >only field.
      >>
      >Some of the kennels have the word "The" as the first word in the name
      >and they do not want to be listed alphabetically by "The..."
      >>
      >Is there a way that I can request that mysql ignore "The" in a kennel
      >name when ordering it or must I create a new field for the ordering
      >and remove the "The" from the kennel name for that field ?
      >>
      >bill
      >
      comp.databases. mysql would be a much better place to ask this question.
      >
      my isp does not supply this ng.

      can someone point me to a portal that will allow me to access it ?

      bill

      Comment

      • strawberry

        #4
        Re: ordering mysql request by part of a key


        bill wrote:
        Jerry Stuckle wrote:
        bill wrote:
        I have a database of kennels. One page lists the kennels
        alphabetically by kennel name.
        I have a field for kennel name and an index with kennel name as the
        only field.
        >
        Some of the kennels have the word "The" as the first word in the name
        and they do not want to be listed alphabetically by "The..."
        >
        Is there a way that I can request that mysql ignore "The" in a kennel
        name when ordering it or must I create a new field for the ordering
        and remove the "The" from the kennel name for that field ?
        >
        bill
        comp.databases. mysql would be a much better place to ask this question.
        my isp does not supply this ng.
        My earlier reply seems to have got lost:

        SELECT kennel FROM kennels ORDER BY REPLACE(kennel, 'the','');
        >
        can someone point me to a portal that will allow me to access it ?
        >
        bill

        Comment

        • strawberry

          #5
          Re: ordering mysql request by part of a key


          bill wrote:
          Jerry Stuckle wrote:
          bill wrote:
          I have a database of kennels. One page lists the kennels
          alphabetically by kennel name.
          I have a field for kennel name and an index with kennel name as the
          only field.
          >
          Some of the kennels have the word "The" as the first word in the name
          and they do not want to be listed alphabetically by "The..."
          >
          Is there a way that I can request that mysql ignore "The" in a kennel
          name when ordering it or must I create a new field for the ordering
          and remove the "The" from the kennel name for that field ?
          >
          bill
          comp.databases. mysql would be a much better place to ask this question.
          my isp does not supply this ng.
          My earlier reply seems to have got lost:

          SELECT kennel FROM kennels ORDER BY REPLACE(kennel, 'the ','');
          >
          can someone point me to a portal that will allow me to access it ?
          >
          bill

          Comment

          • Jerry Stuckle

            #6
            Re: ordering mysql request by part of a key

            bill wrote:
            Jerry Stuckle wrote:
            >
            >bill wrote:
            >>
            >>I have a database of kennels. One page lists the kennels
            >>alphabeticall y by kennel name.
            >>I have a field for kennel name and an index with kennel name as the
            >>only field.
            >>>
            >>Some of the kennels have the word "The" as the first word in the name
            >>and they do not want to be listed alphabetically by "The..."
            >>>
            >>Is there a way that I can request that mysql ignore "The" in a kennel
            >>name when ordering it or must I create a new field for the ordering
            >>and remove the "The" from the kennel name for that field ?
            >>>
            >>bill
            >>
            >>
            >comp.databases .mysql would be a much better place to ask this question.
            >>
            my isp does not supply this ng.
            >
            can someone point me to a portal that will allow me to access it ?
            >
            bill
            1. Ask your ISP to carry it. I've found most are quite amiable to
            adding groups at user's requests.

            2. Google Groups (if you really must).

            --
            =============== ===
            Remove the "x" from my email address
            Jerry Stuckle
            JDS Computer Training Corp.
            jstucklex@attgl obal.net
            =============== ===

            Comment

            • bill

              #7
              Re: ordering mysql request by part of a key

              strawberry wrote:
              bill wrote:
              >Jerry Stuckle wrote:
              >>bill wrote:
              >>>I have a database of kennels. One page lists the kennels
              >>>alphabetical ly by kennel name.
              >>>I have a field for kennel name and an index with kennel name as the
              >>>only field.
              >>>>
              >>>Some of the kennels have the word "The" as the first word in the name
              >>>and they do not want to be listed alphabetically by "The..."
              >>>>
              >>>Is there a way that I can request that mysql ignore "The" in a kennel
              >>>name when ordering it or must I create a new field for the ordering
              >>>and remove the "The" from the kennel name for that field ?
              >>>>
              >>>bill
              >>comp.database s.mysql would be a much better place to ask this question.
              >>>
              >my isp does not supply this ng.
              >
              My earlier reply seems to have got lost:
              >
              SELECT kennel FROM kennels ORDER BY REPLACE(kennel, 'the ','');
              well, that is easy enough.
              Many thanks.

              bill

              Comment

              • bill

                #8
                Re: ordering mysql request by part of a key

                Jerry Stuckle wrote:
                bill wrote:
                >Jerry Stuckle wrote:
                >>
                >>bill wrote:
                >>>
                >>>I have a database of kennels. One page lists the kennels
                >>>alphabetical ly by kennel name.
                >>>I have a field for kennel name and an index with kennel name as the
                >>>only field.
                >>>>
                >>>Some of the kennels have the word "The" as the first word in the
                >>>name and they do not want to be listed alphabetically by "The..."
                >>>>
                >>>Is there a way that I can request that mysql ignore "The" in a
                >>>kennel name when ordering it or must I create a new field for the
                >>>ordering and remove the "The" from the kennel name for that field ?
                >>>>
                >>>bill
                >>>
                >>>
                >>comp.database s.mysql would be a much better place to ask this question.
                >>>
                >my isp does not supply this ng.
                >>
                >can someone point me to a portal that will allow me to access it ?
                >>
                >bill
                >
                1. Ask your ISP to carry it. I've found most are quite amiable to
                adding groups at user's requests.
                been there, done that, no response to my request. (but it has
                only been 7 days, so far :-\
                >
                2. Google Groups (if you really must).
                Only if the wonderful people on this ng can't help.


                bill

                Comment

                • Jerry Stuckle

                  #9
                  Re: ordering mysql request by part of a key

                  bill wrote:
                  Jerry Stuckle wrote:
                  >
                  >bill wrote:
                  >>
                  >>Jerry Stuckle wrote:
                  >>>
                  >>>bill wrote:
                  >>>>
                  >>>>I have a database of kennels. One page lists the kennels
                  >>>>alphabetica lly by kennel name.
                  >>>>I have a field for kennel name and an index with kennel name as the
                  >>>>only field.
                  >>>>>
                  >>>>Some of the kennels have the word "The" as the first word in the
                  >>>>name and they do not want to be listed alphabetically by "The..."
                  >>>>>
                  >>>>Is there a way that I can request that mysql ignore "The" in a
                  >>>>kennel name when ordering it or must I create a new field for the
                  >>>>ordering and remove the "The" from the kennel name for that field ?
                  >>>>>
                  >>>>bill
                  >>>>
                  >>>>
                  >>>>
                  >>>comp.databas es.mysql would be a much better place to ask this question.
                  >>>>
                  >>my isp does not supply this ng.
                  >>>
                  >>can someone point me to a portal that will allow me to access it ?
                  >>>
                  >>bill
                  >>
                  >>
                  >1. Ask your ISP to carry it. I've found most are quite amiable to
                  >adding groups at user's requests.
                  >
                  >
                  been there, done that, no response to my request. (but it has only been
                  7 days, so far :-\
                  >
                  >>
                  >2. Google Groups (if you really must).
                  >
                  >
                  Only if the wonderful people on this ng can't help.
                  >
                  >
                  bill
                  >
                  The point is - this is not a mysql newsgroup. You should take your
                  questions to the appropriate newsgroup. That's why comp.databases. mysql
                  was created.

                  And I would suggest you ask your isp again. It might have gotten lost
                  during the holidays.


                  --
                  =============== ===
                  Remove the "x" from my email address
                  Jerry Stuckle
                  JDS Computer Training Corp.
                  jstucklex@attgl obal.net
                  =============== ===

                  Comment

                  • bill

                    #10
                    Re: ordering mysql request by part of a key

                    Jerry Stuckle wrote:
                    ....
                    The point is - this is not a mysql newsgroup. You should take your
                    questions to the appropriate newsgroup. That's why comp.databases. mysql
                    was created.
                    >
                    And I would suggest you ask your isp again. It might have gotten lost
                    during the holidays.
                    >
                    >
                    Please allow me to cordially disagree with you.
                    Having been to the mysql reference website I find that while the
                    information is there, it is almost all oriented towards command
                    line usage, not from within PHP.

                    bill

                    Comment

                    • Andy Hassall

                      #11
                      Re: ordering mysql request by part of a key

                      On Sun, 31 Dec 2006 10:24:37 -0500, bill <nobody@spamcop .netwrote:
                      >Jerry Stuckle wrote:
                      >...
                      >The point is - this is not a mysql newsgroup. You should take your
                      >questions to the appropriate newsgroup. That's why comp.databases. mysql
                      >was created.
                      >>
                      >And I would suggest you ask your isp again. It might have gotten lost
                      >during the holidays.
                      >
                      >Please allow me to cordially disagree with you.
                      >Having been to the mysql reference website I find that while the
                      >information is there, it is almost all oriented towards command
                      >line usage, not from within PHP.
                      The questions you've asked have both been about SQL which MySQL runs, not PHP.
                      Since the answer is the same whether you send the SQL from a command line or
                      from any other language then they aren't really on topic here in a PHP group.

                      This was one reason why comp.databases. mysql was created; here is a quote from
                      the original rationale when the group was proposed:

                      "There is no dedicated newsgroup for MySQL in the comp.* hierarchy and, as a
                      result, most of the discussions of MySQL take place in the comp.lang.php
                      newsgroup. This is unsatisfactory because MySQL is not in any intrinsic way
                      related to the PHP language, and users of MySQL who do not use it in
                      conjunction with PHP front ends are unlikely to know to look for discussions
                      of MySQL there. In addition, discussion of issues related to MySQL but not
                      to PHP are off-topic for comp.lang.php. A new group specifically for MySQL
                      would offer a place where all users of MySQL could participate without
                      risking being off-topic for the group and where all users of MySQL could
                      easily discover the group."

                      The charter for comp.lang.php contains:

                      "A group alt.php.sql also currently exists, but is less frequently used than
                      alt.php. Since database connectivity is a large part of PHP, it will be
                      considered topical in comp.lang.php. A comp.lang.php.s ql is not deemed
                      necessary at the current point in time, however may be proposed at a later
                      point should the need arise. "

                      ... but it only mentions database _connectivity_, so that's questions on how
                      to get connected to the database, including setting up the extensions, and how
                      to use the PHP side of the APIs to get your data in and out of PHP data
                      structures - but that doesn't cover how to use the database you're connected
                      to.

                      Since comp.databases. mysql is in one of the "Big-8" hierarchies (the older,
                      more official ones as opposed to the alt.* groups) then your ISP really should
                      add it, arguably it should have done it automatically ages ago. ISPs are
                      generally pretty useless though when it comes to Usenet. news.individual .net is
                      a cheap way of getting access to a good Usenet server if your ISP isn't up to
                      the job.

                      --
                      Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
                      http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

                      Comment

                      Working...