K
K
Kactus2020-05-12 22:29:07
MySQL
Kactus, 2020-05-12 22:29:07

How to display correctly mysql results?

Hello, the essence is this, there is a table in it there is a type column that can have the value win and lose. Need to display the amount of win after lose

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lazy @BojackHorseman MySQL, 2020-05-12
@Kactus

SELECT COUNT(*) FROM <tablename> 
WHERE `type` = 'win' AND <id_fieldname> > 
(SELECT MAX(<id_fieldname>) FROM  <tablename> WHERE `type` = 'lose')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question