pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: jayknowsunix@gmail.com
To: Silvio Brandani <silvio.brandani@tech.sdb.it>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: order by query wrong result
Date: Wed, 19 Nov 2014 09:07:33 -0500
Message-ID: <CB75D42A-9FCD-46D7-AF05-F005BF820385@gmail.com> (raw)
In-Reply-To: <546CA188.705@tech.sdb.it>
References: <546CA188.705@tech.sdb.it>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

That doesn't look like an error to me. The upper() function is only converting your name field to upper case and then the "order by" is simply alphabetical based on that, which is what your return values are. What are you expecting to get back? Your query probably needs adjusting.

--Jay

Sent from my iPad

> On Nov 19, 2014, at 8:56 AM, Silvio Brandani <silvio.brandani@tech.sdb.it> wrote:
> 
> 
> Hi all,
> 
> we have a  query with wrong result  in order by :
> 
> select *
> from prova
> where name ilike 'savino del bene s%'
> and record_status = 'A'
> order by upper(name);
> 
> 
> and we get:
> 
> 
> Savino Del Bene Santo Domingo
> Savino Del Bene Singapore
> Savino Del Bene Singapore - Airport Office
> Savino Del Bene South Africa - Cape Town
> Savino Del Bene South Africa - Durban
> Savino Del Bene South Africa - Johannesburg
> Savino Del Bene South Africa - Port Elizabeth
> Savino Del Bene S.p.A. Campogalliano (MO)
> Savino Del Bene S.p.A. Capodichino
> Savino Del Bene S.p.A. Firenze
> Savino Del Bene S.p.A. Genova
> Savino Del Bene S.p.A. Headquarters
> Savino Del Bene Spain S.L. - Alicante
> Savino Del Bene Spain S.L. - Barcelona
> Savino Del Bene Spain S.L. - Bilbao
> Savino Del Bene Spain S.L. - Madrid
> Savino Del Bene Spain S.L. - Palma de Mallorca
> Savino Del Bene Spain S.L. - Valencia
> Savino Del Bene Spain S.L. - Valencia Headquarter
> Savino Del Bene Spain S.L. - Vigo
> Savino Del Bene S.p.A. Livorno
> Savino Del Bene S.p.A. Livorno ufficio Genova c/o Spedimar  S.r.L.
> Savino Del Bene S.p.A. Livorno ufficio La Spezia
> Savino Del Bene S.p.A. Milano
> Savino Del Bene S.p.A. Montecosaro Scalo
> Savino Del Bene S.p.A. Montemurlo (PO)
> Savino Del Bene S.p.A. Napoli
> Savino Del Bene S.p.A. Osmannoro(FI)
> Savino Del Bene S.p.A. Oste (PO)
> Savino Del Bene S.p.A. Padova
> Savino Del Bene S.p.A. Pietrasanta
> Savino Del Bene S.p.A. Pisa
> Savino Del Bene S.p.A. San Miniato
> Savino Del Bene S.p.A. Torino
> Savino Del Bene S.p.A. Treviso
> Savino Del Bene S.p.A. Udine
> Savino Del Bene S.p.A. Verona
> Savino Del Bene S.p.A. Vicenza
> Savino Del Bene Switzerland AG - Basel
> Savino Del Bene Switzerland - Rancate
> 
> 
> Each help higly appreciated,
> 
> Silvio Brandani
> 
> 
> --------------------------------------------------------------------------------
> 
> 
> 
> This message is for the recipients only. If you receive it in error, please notify the sender and delete it together with any attachments. For any further information, including our privacy policy please refer to http://www.savinodelbene.com/privacy/
> 
> 
> 
> --------------------------------------------------------------------------------
> 
> 
> -- 
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



view thread (14+ messages)  latest in thread

Message-ID: <CB75D42A-9FCD-46D7-AF05-F005BF820385@gmail.com>
Permalink:  ../CB75D42A-9FCD-46D7-AF05-F005BF820385@gmail.com/
Also on:    postgresql.org/message-id/CB75D42A-9FCD-46D7-AF05-F005BF820385@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: jayknowsunix@gmail.com, silvio.brandani@tech.sdb.it
  Subject: Re: order by query wrong result
  In-Reply-To: <CB75D42A-9FCD-46D7-AF05-F005BF820385@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox