Kusum Kusum - 1 year ago 126
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
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download