MySQL Forums
Forum List  »  Newbie

MySQL Subquery Problem
Posted by: Matt
Date: June 06, 2005 12:47PM

Here is a database created for the purpose of this SUBJECT:

CREATE TABLE `user_info` (
`id` int(7) NOT NULL auto_increment,
`name` varchar(40) NOT NULL default '',
`ip` varchar(15) NOT NULL default '',
`opp_name` varchar(40) NOT NULL default '',
`opp_ip` varchar(15) NOT NULL default '',
`play` tinyint(1) NOT NULL default '0',
`date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
)

How to form a single/multiple subquery to solve such problems:

1. Delete all users that have the TIMESTAMP older than 1day
2. Exchange values between 2 users, so that User_1st.(name, ip)>>User_2nd.(opp_name, opp_ip) and vice versa than set the value PLAY for both users to 1

PS> Do you think it is possible to make a single/multi subquery solving the problem above? I have resigned and don;t really know what to do with it.

Options: ReplyQuote


Subject
Written By
Posted
MySQL Subquery Problem
June 06, 2005 12:47PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.