How to join two tables together with same number of rows by their order

前端 未结 9 1973
庸人自扰
庸人自扰 2020-12-19 04:38

I am using SQL2000 and I would like to join two table together based on their positions

For example consider the following 2 tables:

table1
-------
name
-         


        
9条回答
  •  梦毁少年i
    2020-12-19 04:53

    This is NOT possible, since there's absolutely no guarantee regarding the order in which the rows will be selected.

    There are a number of ways to achieve what you want (see other answers) provided you're lucky regarding the sorting order, but none will work if you aren't, and you shouldn't rely on such queries.

    Being forced to do this kind of queries strongly smells of a bad database design.

提交回复
热议问题