| |

VerySource

 Forgot password?
 Register
Search
View: 1192|Reply: 11

I do n’t know what's wrong, there is a syntax error near i

[Copy link]

2

Threads

10

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

Post time: 2020-3-16 14:00:01
| Show all posts |Read mode
Reading records 2-10, there is a grammatical error near i, please master help?
Set Dets = Conn.Execute ("select top 10 i.bid, i.id, i.title, i.pic, i.path, b.name, b.orderid from info as i, infobigsort as b where i.id not in (select top 10 i.id, b.orderid from info as i, infobidsoft as b where i.bid = b.orderid and i.Commend_index = 1 and agree = 1 order by i.addtime desc) i.bid = b.orderid and i.Commend_index = 1 and agree = 1 order by i.addtime desc ")
Reply

Use magic Report

0

Threads

26

Posts

20.00

Credits

Newbie

Rank: 1

Credits
20.00

 China

Post time: 2020-6-16 17:00:01
| Show all posts
You first test whether your SQL statement is successful.
Reply

Use magic Report

2

Threads

10

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

 Author| Post time: 2020-6-16 23:30:01
| Show all posts
How to test it, never used it, there is a syntax error near'i'.
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-6-17 01:30:01
| Show all posts
Halo Lake.........Learning ING

Where did I come from? It looks a bit similar to the one that has not been declared but quoted first
Reply

Use magic Report

2

Threads

10

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

 Author| Post time: 2020-6-17 13:00:01
| Show all posts
info as i, right here,
Set Dets=Conn.Execute("select top 10 i.bid,i.id,i.title,i.pic,i.path, b.name,b.orderid from info as i,infobigsort as b where i.bid =b.orderid and i.Commend_index=1 and agree=1 order by i.addtime desc")
This alone is correct
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-6-18 00:00:01
| Show all posts
i.bid=b.orderid and i.Commend_index=1 and agree=1 order by i.addtime desc which query is the last one? There should be two queries here.
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-6-18 09:00:01
| Show all posts
Try to remove this: i.bid=b.orderid and i.Commend_index=1 and agree=1 order by i.addtime desc")
Reply

Use magic Report

2

Threads

10

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

 Author| Post time: 2020-6-18 21:45:01
| Show all posts
Is to go to that bracket
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-6-19 20:45:01
| Show all posts
the last one
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-6-19 21:00:01
| Show all posts
Your WHERE condition is wrong, change it to this:
Set Dets=Conn.Execute("select top 10 i.bid,i.id,i.title,i.pic,i.path, b.name,b.orderid from info as i,infobigsort as b where i.id not in(select top 10 i.id,b.orderid from info as i,infobidsoft as b where i.bid=b.orderid and i.Commend_index=1 and agree=1 order by i.addtime desc) AND i.bid =b.orderid and i.Commend_index=1 and agree=1 order by i.addtime desc")
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