Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Syntax for minimum amount

Posted on 2004-10-06
1
Medium Priority
?
260 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 26

Accepted Solution

by:
Umesh earned 2000 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

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

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

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

722 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