I'd like to know how to how to make a query that does this:
I have a table like this:
CREATE TABLE `sendingServers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` text NOT NULL,
`address` text NOT NULL,
`token` text NOT NULL,
`lastPoll` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
And I'd like to get the following:
- Select all servers where
lastPollis less then X seconds ago - Then select a random entry from the return value
Is this possible ? How do I achieve that ?