Linked Questions

5 votes
2 answers
14k views

Possible Duplicate: How to select the nth row in a SQL database table? I have a table that I want to select Select 1 record and in other command I want to select second row and in other command ...
Persian.'s user avatar
  • 1,035
-4 votes
2 answers
3k views

I have written sql query Select * from Products WHERE Products.Category=="Fruits"; the returned answer is 1-Banana 2-Mango 3-Apple 4-Oranges 5-Grapes now i want to select fruit at index ...
Nouman Arshad's user avatar
-1 votes
2 answers
1k views

I am trying to load content as the user scrolls from my database. I am trying to load 10 items at a time in order. currently I have achieved everything I want to do except I am loading the first 10 ...
OT2O's user avatar
  • 61
0 votes
1 answer
2k views

I am new to MySQL database. So I want to know the exact SQL query to fetch Nth row. Please help me solve this issue. Thanks in advance.
Bichu's user avatar
  • 27
1 vote
2 answers
454 views

Is it possible to get a table record depending on the row number? For example, I have a table with 40 records and I need to get the 27th record. I need some query like SELECT * FROM my_table WHERE **...
Daniel Bednář's user avatar
0 votes
0 answers
160 views

How we can print the second last row from the table using SQL query.
Murari's user avatar
  • 1
0 votes
3 answers
99 views

I want to get the second record from bottom. I tried SELECT TOP 2 meetings_id FROM meetings ORDER BY meetings_date DESC EXCEPT SELECT TOP 1 meetings_id FROM meetings ORDER BY meetings_date DESC But ...
george sobhy's user avatar
0 votes
0 answers
115 views

I can get second highest salary by this query. is it possible to use this query for calculate fifth highest salary?? SELECT max(salary) FROM [Employee] where (EmployeeID not in (SELECT max(...
Barun Kumar's user avatar
-1 votes
3 answers
109 views

/$sql = "SELECT * FROM tb_cad WHERE name like '$src_names%' ORDER BY id ASC"; $query = mysqli_query($conn, $sql); Id | name ------------ 1 James 2 Claus 7 John 10 Maria 21 ...
Erasmo's user avatar
  • 1
0 votes
0 answers
56 views

I have a table having business days stored into it. I want to get 5th business day based on the input date i give. For an example please consider below table BUSINESS DAY 8/06/2004 12:00:00 AM 8/...
Vivek Ravi's user avatar
213 votes
46 answers
517k views

What is the simplest SQL query to find the second largest integer value in a specific column? There are maybe duplicate values in the column.
Niyaz's user avatar
  • 55k
103 votes
17 answers
138k views

Is it possible to build a single mysql query (without variables) to remove all records from the table, except latest N (sorted by id desc)? Something like this, only it doesn't work :) delete from ...
serg's user avatar
  • 112k
24 votes
5 answers
92k views

We have a piece of software that does not delete entries we no longer want. In order to get a feel for how much data is wasting away in our server and prepare for a big cleanup operation, I am trying ...
Jonathon Anderson's user avatar
11 votes
4 answers
5k views

Hi i have 100 records in my SQL table i want to sort them ASC by name but i need one record on top of all record nr 43. Is there way i can pull this record 43 first and then everything else ASC order ...
BUddhaxx's user avatar
  • 151
9 votes
5 answers
36k views

I want to execute 2 separated commands to return me a value from my table. the first one could be top 1, because is the first line, no problem... but how can I make something like top 2, but only ...
Bruno 'Shady''s user avatar

15 30 50 per page