Solved

Syntax for minimum amount

Posted on 2004-10-06
1
253 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

760 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now