Re: Searching for big differences between values

From: Chris Travers <chris(dot)travers(at)gmail(dot)com>
To: Durumdara <durumdara(at)gmail(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Searching for big differences between values
Date: 2017-11-30 09:23:21
Message-ID: CAKt_Zfsg6aqUOehxiopXXbemx0sZrgC38prdgrQ0WWyTR5tbqQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Nov 30, 2017 08:35, "Durumdara" <durumdara(at)gmail(dot)com> wrote:

Hello!

Somewhere the users made mistakes on prices (stock).

I need to search for big differences between values.
For example:

20
21
21,5
30
28
..
46392 <-
46392 <-

But it could be:

42300
43100
44000
43800
65000 <-
42100

Human eye could locate these values, but there we need to check 30.000
articles and 450.000 values.

Do you have any idea, how to this with SQL?

In most cases the first values are ok, the second interval (after a date)
it could be wrong...

I don't know how to define the solution, but I think PGSQL have intelligent
solution for this problem.

We need to search for elements have bigger value like base price *
tolerance.
But the base price is calculated dynamically from the lower values... The
tolerance is lower on highest base prices.

The good news is relational dbs excel at performing. However you have not
provided nearly enough info to help write a query. How are such things
calculated?

Thank you for any help!

Best regards
dd

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter J. Holzer 2017-11-30 10:22:09 Re: large numbers of inserts out of memory strategy
Previous Message Durumdara 2017-11-30 07:35:20 Searching for big differences between values