How to add SQL query?

To search for duplicates on the IP address execute this SQL query through phpmyadmin

SELECT *
FROM the sessions
WHERE EXISTS
(
 SELECT 1
 FROM the sessions
 WHERE ip_address = ip_address
 LIMIT 1, 1
 )


I need to add to the query to output rows where the extra column user_id IS NOT NULL
Please help
March 19th 20 at 08:58
1 answer
March 19th 20 at 09:00
Good morning.
SELECT *** FROM *** WHERE *** AND `user_id` IS NOT NULL

Find more questions by tags MySQL