/build/static/layout/Breadcrumb_cap_w.png

Need help with sql report

Hi SQL Guru's,

I need to create a report that shows the results of SCAP scans from the K1000.  I have this so far for my sql code but it is returning way more records than there should be. Can anyone take a look and see what I have done wrong?  Thanks in advance.

 

SELECT

MACHINE.NAME AS COMPUTER,

SCAP_PROFILE.TITLE,

SCAP_RESULT.RESULT_VALUE,

SCAP_RESULT_RULE.RULE_IDREF,

SCAP_GROUP.TITLE

FROM MACHINE,SCAP_PROFILE,SCAP_RESULT,SCAP_BENCHMARK,SCAP_RESULT_RULE,SCAP_GROUP

WHERE

SCAP_RESULT.MACHINE_ID = MACHINE.ID

AND

SCAP_RESULT.SCAP_PROFILE_ID = SCAP_PROFILE.ID

AND

SCAP_RESULT_RULE.SCAP_RESULT_ID = SCAP_RESULT.ID

AND

SCAP_PROFILE.SCAP_BENCHMARK_ID = SCAP_BENCHMARK.ID

AND

SCAP_GROUP.SCAP_PROFILE_ID = SCAP_PROFILE.ID

ORDER BY MACHINE.NAME


1 Comment   [ + ] Show comment
  • We are running 5.5.90546 of the k1000. - Timi 10 years ago

Answers (1)

Posted by: zookdj 10 years ago
Second Degree Blue Belt
0

Have you tried using JOIN instead of listing the tables after the FROM statement?  e.g.: "FROM MACHINE INNER JOIN SCAP_PROFILE ON ..."

See http://dev.mysql.com/doc/refman/5.0/en/join.html for more details.

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ