Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

help with query (delete lowest value)

 
   Database Forums (Home) -> mySQL RSS
Next:  not for replication  
Author Message
starman7

External


Since: Mar 01, 2006
Posts: 7



(Msg. 1) Posted: Mon Mar 20, 2006 10:08 am
Post subject: help with query (delete lowest value)
Archived from groups: mailing>database>mysql (more info?)

i have a table with objects in categories and their positions.

there will be several rows with category 400, and they will have
various positions, i want to delete only the row with the lowest
position.

i can select the row i want to delete, but don't know how to delete
just this row.

here's my select:

SELECT * FROM categories WHERE category = 400 order by position limit 1

thanks for your help.
s7

ps - is there any cron-like facility within mysql to do this for me,
once every weekday?

 >> Stay informed about: help with query (delete lowest value) 
Back to top
Login to vote
starman7

External


Since: Mar 01, 2006
Posts: 7



(Msg. 2) Posted: Mon Mar 20, 2006 1:05 pm
Post subject: Re: help with query (delete lowest value) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

tried the other query and received this:

#1066 - Not unique table/alias: 'c1'

shoud as c1 be as 'something else'?

 >> Stay informed about: help with query (delete lowest value) 
Back to top
Login to vote
starman7

External


Since: Mar 01, 2006
Posts: 7



(Msg. 3) Posted: Mon Mar 20, 2006 1:23 pm
Post subject: Re: help with query (delete lowest value) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

when i changed delete c1 to select * - the row is isolated, and it's
the one i want deleted...
 >> Stay informed about: help with query (delete lowest value) 
Back to top
Login to vote
starman7

External


Since: Mar 01, 2006
Posts: 7



(Msg. 4) Posted: Mon Mar 20, 2006 1:25 pm
Post subject: Re: help with query (delete lowest value) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

i meant when i changed 'delete from' to 'select * from'
 >> Stay informed about: help with query (delete lowest value) 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
multi delete - Hi, I have MySQL 5.0.22 and I can't seem to do multiple delete 100% on InnoDB table with Foriegn Key. What should the correct syntax be?

Delete table data completely - Hi, I can't seem to find a way to delete all records of a table. I created my tables in MySQL Query Browser, then fill them up with VC++, but some records were incorrect, And I had to recreate the table again. So please help, I just wanted to delete..

Help with an SQL query? - I have a table in which the records a bunch of fields; for this query, I'm interested in three of them - let's call them Fld1, Fld2 and Fld3. For each record in the table, these fields may or may not contain data (a stock ticker symbol - like MSFT, for..

query in a query - Hi Folk I have a query: SELECT COUNT( `SIS`.`ID` ) c, D FROM `SIS` , `SID` WHERE `SID_ID` = `SID`.`ID` AND `BRO` <> "bot" GROUP BY SID.ID And from the results, I want to select the following: SELECT AVG(c), D FROM RESULTS GROUP BY D ...

Need a Query - Hi, I have a table TEST which has the following data coupon status ---------- ----------- 1000 y 1000 y 1000 n 1001 y 1001 y 1001 n 1003 n 1004 n 1005 n Explanation ----------------- Coupon 100...
   Database Forums (Home) -> mySQL All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]