Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 261
  • Last Modified:

Syntax for minimum amount

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
roduno
Asked:
roduno
1 Solution
 
UmeshCommented:
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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now