Hello folks. I'm trying to hammer out this query and having some difficulty. I have four tables, one is a codex which refers to the RecordID of each table with data in it. I've called this one Vuln_Codex. The other three are Vuln_Cats (categories), Vuln_CWE,
and Vuln_OWASP10. The data structure for the codex table is its master record ID and the Record ID of the other three that relate to each other. Below is the schema for these tables:
Vuln_Codex
- Codex_RecID INT ID PK
- cat_id
- cwe_id
- owasp_id
Vuln_Cats
- Cat_RecID
- Cat_Name
- Cat_Description
Vuln_CWE
- CWE_RecID
- CWE_ID (from mitre.org - real world ID for Common Weakness Enumerator)
- CWE_Name
Vuln_OWASP10 (OWASP Top 10)
- O_RecID
- O_Name
- O_Description
- O_Year
What I want to query is the following
Codex_RecID | Cat_Name | Description | CWE-ID | CWE_Name | OWASP Name | OWASP DESCR |
When I had my query that worked, it only presented 10 records, I suspect because of the USING clause. I have 33 records on my Codex table because there are 33 categories.
Here is the query which kind of baffles me because it was working, now it gives me an error:
SELECT vuln_cats.Cat_id, vuln_cats.cat_Name, vuln_cwe.CWE-ID, vuln_cwe.CWE_Name, vuln_OWASP10.O_RecID, vuln_OWASP10.O_Name, vuln_OWASP10.O_Description FROM vuln_codex INNER JOIN vuln_cats USING (Cat_RecID) INNER JOIN vuln_cwe using (CWE_RecID) INNER JOIN vuln_OWASP10 using (O_RecID)
Error Code: 1054. Unknown column 'Cat_RecID' in 'from clause' 0.000 sec