Solved

Syntax for minimum amount

Posted on 2004-10-06
1
255 Views
Last Modified: 2008-01-16
In Mysql how can I request the smallest number in a table field of numbers? Also what would be the syntax for deleting that number after it is pulled?
0
Comment
Question by:roduno
1 Comment
 
LVL 26

Accepted Solution

by:
ushastry earned 500 total points
ID: 12245825
Hi,

Yes u can get the smallest number using MIN() & using user variables you can delete after pulling that small number..

Say u have atble named umesh & has two fields (name,money)..and you want to pull MIN of money & also wants to delete that records..

This would pull the MIN of money..

SELECT @money:=MIN(money) FROM umesh;

This woyuld delete that row..

DELETE FROM umesh WHERE money=@money;
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
I have been using r1soft Continuous Data Protection (http://www.r1soft.com/linux-cdp/) for many years now with the mySQL Addon and wanted to share a trick I have used several times. For those of us that don't have the luxury of using all transact…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question