How do SQL request (MySQL)



  • The situation is as follows, the OBD has two tables:

    1. master (id, name)

    2. employee (id, name)

    I want to build one SELECT request for a data sample.

    I'm making a request.

    SELECT master.name
    FROM master
    UNION ALL
    SELECT employee.name
    FROM master
    

    It's great, but I don't know how to add another sample field to this request.

    That's what I mean,

    SELECT поле23, поле24 + *запрос указанный выше*
    


  • I think the TS doesn't understand what he wants to do... As this is the simplest case, it appears that:

    SELECT master.name, employee.name FROM master, employee WHERE
    master.id == employee.id
    

    In this way, SELECT, at least, has obvious meaning... ♪




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2