Kusum Kusum - 1 year ago 84
SQL Question

Exclude null value during full outer join

How to join these two tables with excluding all null values?

And Instead of UserId in 2nd table I want the user name from first table information.

enter image description here

Answer Source

You can achieve desire result by using INNER JOIN

SELECT UserProfile.*
FROM UserProfile
INNER JOIN UserLoginHistory ON UserProfile.UserId = UserLoginHistory.UserId AND UserLoginHistory.LogoutTime IS NOT NULL