My solution without using join


  • 0
    SELECT  MIN(Distance.distance) AS shortest
    FROM    (
        SELECT  ABS(p1.x - p2.x) AS distance
        FROM    point p1, point p2
        WHERE   p1.x != p2.x
    ) Distance
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.