ORM: getting data from 2 different tables? #19395
Unanswered
jhjacobs81
asked this question in
Questions and Answers
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Recently i begun learning V to do web programming, and in the future other projects. As a project i started on creating a CMDB, because i need one, and because you learn best by doing things. So far so good, but now i ran into an ORM question i can't seem to find the answer for.
I have a table called companies, which has a UUID, a Name etc.. inside the CMDB i have a page which shows the device details, also which company it belongs to. This currently shows the UUID, so how do i get the company name from one table, that coresponds with the data from another table? Does that make any sense? In plain SQL this would be a JOIN statement i think?
Table: Companies
columns: uuid, name, '...'
Table: Hardware
colums: uuid, owner, company_uuid, '...'
So when i request data from the table Hardware, it should request the colum name from table Companies based on the company_uuid data in Hardware
Beta Was this translation helpful? Give feedback.
All reactions