| |

VerySource

 Forgot password?
 Register
Search
Author: westevil

Find the writing of a SQL statement.

[Copy link]

0

Threads

6

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-7-6 16:00:01
| Show all posts
Sorry, I would like to ask, can such a query be used on a database with a large amount of data? For example, if the query is performed on a data table with 5 million records, will it be very slow?
Reply

Use magic Report

2

Threads

18

Posts

13.00

Credits

Newbie

Rank: 1

Credits
13.00

 China

 Author| Post time: 2020-7-8 10:45:01
| Show all posts
If there are other methods, this method can of course not be used. Of course, this method is a bit inefficient.

The problem is that I want to group the InQuantOrders and OutStockOrders statistics based on ModelsInfoNO and ShopWarehouseNO.
Reply

Use magic Report

0

Threads

48

Posts

30.00

Credits

Newbie

Rank: 1

Credits
30.00

 China

Post time: 2020-7-10 07:45:01
| Show all posts
The specified join must have a relationship and describe
FROM
(
SELECT DISTINCT ModelInfoNO FROM [InStockOrder Details]
union
SELECT DISTINCT ModelInfoNO FROM [OutStockOrder Details]
) A_x
INNER JOIN
(
SELECT DISTINCT InShopWarehouseNO AS ShopWarehouseNO FROM [InStockOrders]
union
SELECT DISTINCT OutShopWarehouseNO FROM [OutStockOrders]
)A_y
Is there a relationship description? ?
Reply

Use magic Report

2

Threads

18

Posts

13.00

Credits

Newbie

Rank: 1

Credits
13.00

 China

 Author| Post time: 2020-7-12 09:45:01
| Show all posts
I just don't know how to connect the two sets behind FROM, and there is no relationship between the two sets after FROM. I just have to do the following queries based on these two sets.


Is there any other way to achieve my desired function?
Reply

Use magic Report

0

Threads

48

Posts

30.00

Credits

Newbie

Rank: 1

Credits
30.00

 China

Post time: 2020-7-12 12:00:01
| Show all posts
from a join c on a.column=c.column join b on b.column=c.column
Reply

Use magic Report

2

Threads

18

Posts

13.00

Credits

Newbie

Rank: 1

Credits
13.00

 China

 Author| Post time: 2020-8-3 15:15:01
| Show all posts
no, sorry,

There are two behind my from

Such as
select ... from a,b
left join c on a.col = c.col and b.col = c.col2
left join d on a.col = d.col and b.col = d.col2

left join e on e.col = b.col
left join f on f.col = a.col

order by a.col
Reply

Use magic Report

0

Threads

48

Posts

30.00

Credits

Newbie

Rank: 1

Credits
30.00

 China

Post time: 2020-8-3 17:15:02
| Show all posts
What is the relationship between the two, united, or are they related to the latter?
What is your intention?
Fight 2V1 or 1V1V1
Reply

Use magic Report

2

Threads

18

Posts

13.00

Credits

Newbie

Rank: 1

Credits
13.00

 China

 Author| Post time: 2020-8-4 22:15:01
| Show all posts
The two behind from have nothing to do with each other, they are relatively independent, but the left join on will use them for query conditions. You can look at all the codes above.
Reply

Use magic Report

0

Threads

48

Posts

30.00

Credits

Newbie

Rank: 1

Credits
30.00

 China

Post time: 2020-8-5 16:45:01
| Show all posts
from a join c on a.column=c.column join b on b.column=c.column
Reply

Use magic Report

2

Threads

18

Posts

13.00

Credits

Newbie

Rank: 1

Credits
13.00

 China

 Author| Post time: 2020-8-6 00:45:01
| Show all posts
No, the eldest brother upstairs, I changed it as you did, but the data I found is wrong.

Don't you help me write it out completely.
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