A
A
Ainur Shakirov2016-07-20 10:44:21
MySQL
Ainur Shakirov, 2016-07-20 10:44:21

Why doesn't MIN() work in SQL query?

I make a request:

SELECT MIN(PRICE) `table` where ARTICLE='123' AND BRAND='321';

Gives out:
23.00
but if you remove MIN then it gives out
23.00
5.00

Why doesn't it output "5" but outputs 23?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Ainur Shakirov, 2016-07-20
@Fqyeh29

Problem solved - column was VARCHAR. Converted to DOUBLE - everything is ok.

A
Alexander Ablizin, 2016-07-20
@mcmraak

So the record with the result "5.00" does not match the conditions "where ARTICLE='123' AND BRAND='321'"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question