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