Q:

Display from the 4rd row from the MySQL 'empdata' table, set limit 3

belongs to collection: MySQL Exercises

0

Display the nth row from MySQL table

Display from the 4rd row from the MySQL 'empdata' table, set limit 3

Suppose, we have the following records -

CREATE TABLE IF NOT EXISTS `empdata` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` char(25) NOT NULL,
  `address` varchar(100) NOT NULL,
  `phone` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
INSERT INTO `empdata` (`id`, `name`, `address`, `phone`) VALUES
(6, 'Lussi', 'K-91, Roy Apartment', 909030309),
(4, 'Joya', '15, CP Colony', 342345329),
(5, 'Ammy', '25, JP Colony', 239848342),
(2, 'Priska', '122, JP Colony', 890040908),
(3, 'Abhi', '5, Bank Street', 675748389),
(1, 'Anjali', '121, Vakundh Dham', 840932345);

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

SELECT * FROM `empdata` ORDER BY ID LIMIT 3 OFFSET 3;

This returns the following output -

+----+-------+---------------------+-----------+
| id | name  | address             | phone     |
+----+-------+---------------------+-----------+
|  4 | Joya  | 15, CP Colony       | 342345329 |
|  5 | Ammy  | 25, JP Colony       | 239848342 |
|  6 | Lussi | K-91, Roy Apartment | 909030309 |
+----+-------+---------------------+-----------+

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

MySQL Exercises

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Display from the 5th row from the MySQL 'empd... >>
<< Display the 3rd row from the MySQL 'empdata&#...