Skip to content
Advertisement

Find record that the least amount appears in MySql

I have 2 tables Booked

Books

I’m currently working on this query but the result is not correct.

Output

The result that i want is

Can you help me to fix it? Thanks. Sorry for my bad english

Advertisement

Answer

Your question lacks the clarity but to my instinct of what you have posted may be this will work, as far as i can understand you might want to show the min price on all the records except the min priced record and count the number of the same records, if this is the case, you can try this.

The insert scripts i used to match the data you have posted.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement