Check all users from table 1 if one or more exist in table 2

Alles, was MariaDB und MySQL betrifft, kann hier besprochen werden.

Check all users from table 1 if one or more exist in table 2

Postby hasexxl1988 » 08. January 2024 02:22

Hello,

is it possible to check directly via the database whether an entry from table 1 'Users' is also present in table 2 'Users'? Quasi a like function where it checks all 'Users' from table 1 with the 'Users' in table 2 and outputs whether the user already exists in table 2.

Check all users from table 1 if one or more exist in table 2.

Thanks for the help :)
hasexxl1988
 
Posts: 4
Joined: 08. January 2024 02:17
XAMPP version: 7.1.33
Operating System: Win11

Re: Check all users from table 1 if one or more exist in tab

Postby hasexxl1988 » 08. January 2024 09:30

I rephrase the question, it was described incorrectly:

A database with 2 tables. User1 and User2. Is it possible to check which user from User1 is also present in User2?
hasexxl1988
 
Posts: 4
Joined: 08. January 2024 02:17
XAMPP version: 7.1.33
Operating System: Win11

Re: Check all users from table 1 if one or more exist in tab

Postby Nobbie » 08. January 2024 12:14

Select Distinct User1.Users From User1, User2 Where User1.Users = User2.Users
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04

Re: Check all users from table 1 if one or more exist in tab

Postby hasexxl1988 » 12. January 2024 18:24

Nobbie wrote:Select Distinct User1.Users From User1, User2 Where User1.Users = User2.Users


THANKS :D :D
hasexxl1988
 
Posts: 4
Joined: 08. January 2024 02:17
XAMPP version: 7.1.33
Operating System: Win11


Return to MariaDB - MySQL

Who is online

Users browsing this forum: No registered users and 31 guests