case-insensitive sort

Ask a Question related to Oracle Server, Design and Development.

  1. #1

    Default case-insensitive sort

    How I can implement case-insensitive sort without use function-based index?


    Andrey Voronov Guest

  2. Similar Questions and Discussions

    1. case insensitive REPLACE(...)?
      Hi, I need to search and replace a web address, but the original address could be in any case. Is there a way of doing a case insensitive search...
    2. problems with case insensitive tr/// regexp
      I'm trying to create a script to remove all font tags from an HTML documents. I created a regular expression like this: ,----[ working code |...
    3. #23026 [Com]: Make Zend case-sensitive (classes, functions, remove case-insensitive)
      ID: 23026 Comment by: nvivo at mandic dot com dot br Reported By: mfischer@php.net Status: Open Bug Type: ...
    4. [PHP] case insensitive sort
      Ok. Now I REALLY feel like an idiot. Thanks so much for your help. Steve At 05:46 PM 8/26/2003 +0200, you wrote:
    5. Case-insensitive str_replace
      Hi, I'm trying to replace strings in a body of html. These strings may contain spaces. str_replace works perfectly, except that it is...
  3. #2

    Default Re: case-insensitive sort


    Originally posted by Andrey Voronov
    > How I can implement case-insensitive sort without use function-based
    > index?
    I guess your options are:

    1) ORDER BY UPPER(colname)
    and have a full table scan

    2) Create another column UPPER_COLNAME and a BEFORE INSERT/UPDATE
    trigger that sets :NEW.upper_colname = :NEW.colname;
    create an index on UPPER_COLNAME;
    then ORDER BY upper_colname

    --
    Posted via [url]http://dbforums.com[/url]
    andrewst Guest

  4. #3

    Default Re: case-insensitive sort

    I don't think that necessitates a full table scan. It is an order by which
    is performed AFTER the result is selected. Try it where you get 1 row back
    and do the order by. I would be very surprised if it did a full table scan.
    eg
    select * from emp where emp_no=3 order by upper(last_name)
    (assuming emp_no is the primary key and last_name is a column in the table)
    Jim

    --
    Replace part of the email address: [email]kennedy-down_with_spammers@attbi.com[/email]
    with family. Remove the negative part, keep the minus sign. You can figure
    it out.
    "andrewst" <member14183@dbforums.com> wrote in message
    news:2381014.1042466888@dbforums.com...
    >
    > Originally posted by Andrey Voronov
    > > How I can implement case-insensitive sort without use function-based
    > > index?
    > I guess your options are:
    >
    > 1) ORDER BY UPPER(colname)
    > and have a full table scan
    >
    > 2) Create another column UPPER_COLNAME and a BEFORE INSERT/UPDATE
    > trigger that sets :NEW.upper_colname = :NEW.colname;
    > create an index on UPPER_COLNAME;
    > then ORDER BY upper_colname
    >
    > --
    > Posted via [url]http://dbforums.com[/url]

    Jim Kennedy Guest

  5. #4

    Default Re: case-insensitive sort

    Using SQL Server comes to mind ...

    Your other option is to convert the values to either all upper-case or
    all lower-case and sort (order) on the converted column:

    select ..., ..., ...
    from ...
    where ...
    order by upper(column_name)

    This, of course, is not as fast as having the associated
    function-based index in place, but it does work.

    You could, as an application modification, store the case-insensitive
    values in another column, index that, then perform your order by
    operations. Of course, that requires change control and an outage,
    something you may be willing to do.

    David Fitzjarrell


    "Andrey Voronov" <avoronov@diasoft.ru> wrote in message news:<avtmo8$23jf$1@gavrilo.mtu.ru>...
    > How I can implement case-insensitive sort without use function-based index?
    David Fitzjarrell Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139