sql - How to join two tables together with same number of rows by their order -
I am using SQL2000 and I would like to join two tables at once, based on their status.
For example, consider the following 2 tables:
Table 1 ------- Name ------- 'Cat' 'Dog' 'Mouse' Table 2 - ---- Price ---- - 23 13 25
Now I would like to see my eyes together in two tables, depending on their order based on matching columns ( I both tables The guarantees that have similar rows):
------- | ----- Name | Cost ------- | ------ 'cat' | 23 'dogs' | 13 'mouse' |No is possible because there is absolutely no guarantee about the order in which the rows will be selected.
There are several ways to get what you want (see other answers) If you are lucky about the sorting order, , but no one will work if you And you do not trust these kinds of questions.
Forcing such questions to happen, there is a mess of poor database design.
Comments
Post a Comment