The least squares solution to a linear system is unique if and only if the columns of the coefficient matrix are linearly independent.

math.la.t.linsys.leastsquares.unique