/build/static/layout/Breadcrumb_cap_w.png

Right Syntax for SQL-Report: Windows-Installationen

Hi all,

I don't find the error, what's the correct syntax for:

Subdivision in columns: [[],[]]

["SELECT DISPLAY_NAME, SOFTWARE.ID as TOPIC_ID FROM SOFTWARE  WHERE ((DISPLAY_NAME like 'Microsoft Windows%'))  ORDER BY DISPLAY_NAME","SELECT MACHINE.NAME AS SYSTEM_NAME, MACHINE.ID as TOPIC_ID, GROUP_CONCAT(DISTINCT REPORT_TEMP.TT1.ROW ORDER BY REPORT_TEMP.TT1.ROW) AS PARENT_ROW FROM MACHINE  LEFT JOIN MACHINE_SOFTWARE_JT ON (MACHINE_SOFTWARE_JT.MACHINE_ID = MACHINE.ID) LEFT JOIN SOFTWARE ON (SOFTWARE.ID = MACHINE_SOFTWARE_JT.SOFTWARE_ID) JOIN REPORT_TEMP.TT1 ON (REPORT_TEMP.TT1.ID = SOFTWARE.ID)   GROUP BY MACHINE.ID ORDER BY SYSTEM_NAME"]

Many thanks in advance


0 Comments   [ + ] Show comments

Answers (3)

Posted by: KevinG 3 years ago
Red Belt
0

Please post what columns / information you are trying to report on.

Posted by: Michelle.ashby 3 years ago
Purple Belt
0

When you take off 

Subdivision in columns: [[],[]] as well as the [] within the body I think there is an extra set of ""
this validates:

SELECT

  DISPLAY_NAME,

  SOFTWARE.ID as TOPIC_ID

FROM

  SOFTWARE

WHERE

  ((DISPLAY_NAME like 'Microsoft Windows%'))

ORDER BY

  DISPLAY_NAME,

  "SELECT MACHINE.NAME AS SYSTEM_NAME, MACHINE.ID as TOPIC_ID, GROUP_CONCAT(DISTINCT REPORT_TEMP.TT1.ROW ORDER BY REPORT_TEMP.TT1.ROW) AS PARENT_ROW FROM MACHINE  LEFT JOIN MACHINE_SOFTWARE_JT ON (MACHINE_SOFTWARE_JT.MACHINE_ID = MACHINE.ID) LEFT JOIN SOFTWARE ON (SOFTWARE.ID = MACHINE_SOFTWARE_JT.SOFTWARE_ID) JOIN REPORT_TEMP.TT1 ON (REPORT_TEMP.TT1.ID = SOFTWARE.ID)   GROUP BY MACHINE.ID ORDER BY SYSTEM_NAME"

So that might help you? Not with column names or anything but just as valid syntax.
When I get stuck with brackets or format I will use an online syntax checker like SQL Query Optimizer Tool Online - Free Trial - EverSQL
Not a replacement for sql knowledge but it can help if you are stuck and can't find the error in syntax. 
Posted by: Calligraphy 3 years ago
White Belt
0

Hello everyone, thanks for your answer!

I want to build the report "Windows Installationen" in sql.

http://k1000/adminui/report_create.php?ID=395
http://k1000/adminui/analysis_sql_report.php?ID=395

When i duplicate and save the new report there cames a syntax-error.

When i eliminate the [[],[]] as well as the [] within the body and set the Syntax set to "", the syntax-error is gone but this is not the result of want I'm looking for.

To duplicate the report witch was build with the assistant is no problem. Now I have found another solution for my report with the assistent.

 
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