Kusum Kusum - 10 months ago 59
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


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