| |

VerySource

 Forgot password?
 Register
Search
Author: huoyu5

Wrong? How to read the second record

[Copy link]

2

Threads

10

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

 Author| Post time: 2020-4-5 17:00:01
| Show all posts
Is it top1 or top2?
Reply

Use magic Report

0

Threads

22

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 China

Post time: 2020-4-7 19:00:01
| Show all posts
The inner layer SELECT uses order by, while the outer layer still uses top 1
Reply

Use magic Report

0

Threads

119

Posts

67.00

Credits

Newbie

Rank: 1

Credits
67.00

 China

Post time: 2020-4-9 14:45:01
| Show all posts
SELECT TOP 1 id, title, pic, path, content
FROM info
WHERE id not in
       (SELECT top 1 id from info
        WHERE Commend_Top = 1 AND agree = 1
        ORDER BY addtime desc)
AND Commend_Top = 1 AND agree = 1 ORDER BY addtime desc
Reply

Use magic Report

0

Threads

41

Posts

13.00

Credits

Newbie

Rank: 1

Credits
13.00

 China

Post time: 2020-4-25 19:00:01
| Show all posts
sql =
"select
 id, title, pic, path, content
from info t
where (select count (1) from info where id = t.id and addtime> t.addtime) = 1 and Commend_Top = 1 and agree = 1 order by id desc "
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-4-25 20:15:01
| Show all posts
The landlord should consolidate the language
Reply

Use magic Report

2

Threads

10

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

 Author| Post time: 2020-6-15 00:45:01
| Show all posts
Please correct
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list