Order by in Inner Join

后端 未结 6 791
难免孤独
难免孤独 2021-02-18 16:28

I am putting inner join in my query.I have got the result but didn\'t know that how the data is coming in output.Can anyone tell me that how the Inner join matching the data.Bel

6条回答
  •  灰色年华
    2021-02-18 17:17

    In SQL, the order of the output is not defined unless you specify it in the ORDER BY clause.

    Try this:

    SELECT  *
    FROM    one
    JOIN    two
    ON      one.one_name = two.one_name
    ORDER BY
            one.id
    

提交回复
热议问题