How to check if a given data exists in multiple tables(all different column names)

spod

I have a database where there are 6 different tables (Alpha, Beta, Gamma, Theta, Epsilon, Pi) and there is a users table where one user can be in a different role inside the tables. He can be director of Alpha and Faculty in Beta.

the column names are different in each table(Director, Faculty, Member, Advisor, Student etc)

I need a mysql query which will check if a particular is present in one or more tables against his role.

Thank You.

Bere

Without a table structure, it is difficult to give answers. But assuming you have a user master table and different role based tables you can do the following

  select user.id, a.director, b.faculty, c.member, d.advisor, e.student, f.user from user
    left join alpha a on user.id = a.director
    left join beta b on user.id = b.faculty
    left join gama c on user.id = c.member
    left join ththa d on user.id = d.advisor
    left join epsilon e on user.id = e.student
    left join pi f on user.id = f.user

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to check if a column exists in a matrix or data frame?

From Dev

How to split a data frame into a list of data frame given column names?

From Dev

How to rbind different data frames with different column names?

From Dev

How to check in hibernate that same data with different id exists?

From Dev

How to transform data frame with different column names from wide to long, with different column names

From Dev

How to check if data exists from multiple nested dict using Python

From Dev

How can i check if data exists in multiple places in the state?

From Dev

How to check if a two data frame have the same column names?

From Java

How to check if a column exists in Pandas

From Java

How to check if a column exists in a datatable

From Dev

How to check if column exists in the Datarow

From Dev

how to concat two data frames with different column names in pandas? - python

From Dev

How to merge two data.table by different column names?

From Dev

How to merge two data frames based on different column names

From Dev

How to concatenate data frames with unequal number of rows and different column names

From Dev

How do I check if data in a column already exists and to check the second column of that row to equal a specific number

From Java

How to check if a table exists in a given schema

From Dev

How to check that the given path exists in registry?

From Dev

shell script to check for multiple files with different names

From Dev

shell script to check for multiple files with different names

From Dev

How to check if $routeParams data exists

From Dev

check given date exists between two date column in mysql

From Dev

Insert multiple rows with different column names

From Java

How to check if a column exists in a SQL Server table?

From Dev

How to check if a column exists in Impala table?

From Dev

How to check if a column exists in a pandas MultiIndex

From Dev

Pandas - How to check if multi index column exists

From Dev

How to check if column exists in sqlite in Qt

From Dev

How to check if Username exists in specific column of database

Related Related

  1. 1

    How to check if a column exists in a matrix or data frame?

  2. 2

    How to split a data frame into a list of data frame given column names?

  3. 3

    How to rbind different data frames with different column names?

  4. 4

    How to check in hibernate that same data with different id exists?

  5. 5

    How to transform data frame with different column names from wide to long, with different column names

  6. 6

    How to check if data exists from multiple nested dict using Python

  7. 7

    How can i check if data exists in multiple places in the state?

  8. 8

    How to check if a two data frame have the same column names?

  9. 9

    How to check if a column exists in Pandas

  10. 10

    How to check if a column exists in a datatable

  11. 11

    How to check if column exists in the Datarow

  12. 12

    how to concat two data frames with different column names in pandas? - python

  13. 13

    How to merge two data.table by different column names?

  14. 14

    How to merge two data frames based on different column names

  15. 15

    How to concatenate data frames with unequal number of rows and different column names

  16. 16

    How do I check if data in a column already exists and to check the second column of that row to equal a specific number

  17. 17

    How to check if a table exists in a given schema

  18. 18

    How to check that the given path exists in registry?

  19. 19

    shell script to check for multiple files with different names

  20. 20

    shell script to check for multiple files with different names

  21. 21

    How to check if $routeParams data exists

  22. 22

    check given date exists between two date column in mysql

  23. 23

    Insert multiple rows with different column names

  24. 24

    How to check if a column exists in a SQL Server table?

  25. 25

    How to check if a column exists in Impala table?

  26. 26

    How to check if a column exists in a pandas MultiIndex

  27. 27

    Pandas - How to check if multi index column exists

  28. 28

    How to check if column exists in sqlite in Qt

  29. 29

    How to check if Username exists in specific column of database

HotTag

Archive