﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>LogViewPlus Support » LogViewPlus Support » Help &amp; Support  » impossible to create a select query with sub select ?</title><generator>InstantForum 2017-1 Final</generator><description>LogViewPlus Support</description><link>https://www.logviewplus.com/forum/</link><webMaster>LogViewPlus Support</webMaster><lastBuildDate>Sat, 11 Apr 2026 06:07:44 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: impossible to create a select query with sub select ?</title><link>https://www.logviewplus.com/forum/post/1921</link><description>Just a quick note to&amp;nbsp;let you know that we have now released &lt;a href="https://www.logviewplus.com/download.html" id="if_insertedNode_1701333030927"&gt;LogViewPlus v3.0.24&lt;/a&gt; as a BETA release.&amp;nbsp; &lt;br/&gt;&lt;br/&gt;This release addresses SQL issue discussed above which was related to localization.&amp;nbsp; The fix was relatively straight-forward, but unfortunately the change was bundled with a lot of &lt;a href="https://www.logviewplus.com/releasenotes.html" id="if_insertedNode_1701333114293"&gt;other changes&lt;/a&gt; which needed additional testing before we could release.&amp;nbsp; We would have liked to fix this one faster - apologies for the delay.&lt;br/&gt;&lt;br/&gt;This release also adds the ability to embed a subquery statement into select field.&amp;nbsp; The original SQL statement you posted should now be valid.&lt;br/&gt;&lt;br/&gt;Thanks again for bringing this issue to our attention. Please do let me know if you have any further questions or issues.&lt;br/&gt;&lt;br/&gt;Toby</description><pubDate>Thu, 30 Nov 2023 08:39:58 GMT</pubDate><dc:creator>LogViewPlus Support</dc:creator></item><item><title>impossible to create a select query with sub select ?</title><link>https://www.logviewplus.com/forum/post/1862</link><description>Hello,&lt;br/&gt;&lt;br/&gt;I would have liked to create the following query to get an http response time distribution&amp;nbsp;&amp;nbsp;&lt;br/&gt;&lt;br/&gt;SELECT 'bigger than 3sec', count(*)  as nbrequestbelowtime, (SELECT count(*) as nb_of_request_total  FROM CurrentView where  cs-uri LIKE '%/suite/sites/cpr%')  as  total&lt;br/&gt;FROM CurrentView&lt;br/&gt;where  cs-uri LIKE '%/suite/sites/cpr%' AND time-taken &amp;gt; 3000;&lt;br/&gt;&lt;br/&gt;but after a while i get the following error &lt;br/&gt;&lt;br/&gt;&amp;nbsp;----  Query Failed  ----&lt;br/&gt;&lt;br/&gt;Unable to interpret SELECT statement. Field, function, or expression expected.&lt;br/&gt;&lt;br/&gt;What could be wrong with this query ?&lt;br/&gt;&lt;br/&gt;</description><pubDate>Thu, 30 Nov 2023 08:34:01 GMT</pubDate><dc:creator>DL9442</dc:creator></item><item><title>RE: impossible to create a select query with sub select ?</title><link>https://www.logviewplus.com/forum/post/1873</link><description>What version of LogViewPlus are you using?&amp;nbsp; I am not able to recreate the problem locally:&lt;br/&gt;&lt;br/&gt;&lt;img src="../Uploads/Images/e717a95a-3e6a-4763-8119-afb8.png" data-download-url="../Uploads/Images/4c9675e9-00c9-4586-be8a-1277.png" id="if_insertedNode_1697024493891"&gt;&lt;br/&gt;&lt;br/&gt;I think this might be an issue with culture localization (&lt;a href="https://stackoverflow.com/questions/14163616/1-000-000-is-not-a-valid-value-for-double-c-sharp" id="if_insertedNode_1697024776846"&gt;this post&lt;/a&gt; might be a similar issue).&amp;nbsp; The first error message you reported does not come from LogViewPlus, but the second one does.&amp;nbsp; </description><pubDate>Wed, 11 Oct 2023 11:47:11 GMT</pubDate><dc:creator>LogViewPlus Support</dc:creator></item><item><title>RE: impossible to create a select query with sub select ?</title><link>https://www.logviewplus.com/forum/post/1872</link><description>If i execute the subselect alone, i get the following result&amp;nbsp;&lt;br/&gt;&lt;br/&gt; +---------------------+ &lt;br/&gt; | nbabovetime | total | &lt;br/&gt; +---------------------+ &lt;br/&gt; | 21912&amp;nbsp;&amp;nbsp; | 27061 | &lt;br/&gt; +---------------------+ &lt;br/&gt;&lt;br/&gt;and if i try to extract the percentage with a outer select &lt;br/&gt;&lt;br/&gt;SELECT nbabovetime,total, CAST(ROUND(100.0 * (nbabovetime / total), 2) AS DECIMAL) as Percent&lt;br/&gt;FROM(&lt;br/&gt;&amp;nbsp; SELECT sum(isrequestabovetime) as nbabovetime , count(*) as total &lt;br/&gt;&amp;nbsp; FROM (&lt;br/&gt;&amp;nbsp;&amp;nbsp;  SELECT CASE WHEN time-taken &amp;gt; 1000 THEN 1 ELSE 0 END AS isrequestabovetime,cs-uri FROM CurrentView WHERE cs-uri LIKE '%/suite/webapi/%'&lt;br/&gt;&amp;nbsp; )&lt;br/&gt;);&lt;br/&gt;&lt;br/&gt;i get the Error in ROUND: 100.0 is not a valid value for Double.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Trying different other notations for 100.0 (100,0 or 100 since in Belgium we use different characters to separate decimals)&amp;nbsp; &amp;nbsp; &amp;nbsp;gives&amp;nbsp;&lt;br/&gt;&lt;br/&gt;Function ROUND expects parameter 0 to be of type System.Decimal.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Wed, 11 Oct 2023 11:27:37 GMT</pubDate><dc:creator>DL9442</dc:creator></item><item><title>RE: impossible to create a select query with sub select ?</title><link>https://www.logviewplus.com/forum/post/1869</link><description>Thanks for reporting this issue.&amp;nbsp; &lt;br/&gt;&lt;br/&gt;I had a look at the Round function and couldn't find a matching error message, so I am not sure what could be going wrong.&amp;nbsp; I have tested the 'Round' SQL statement above and it seems to be working fine.&amp;nbsp; Do you know what data type you are passing into the Round function?&amp;nbsp; Is '100.0' a string?&amp;nbsp; Are you able to paste the full SQL statement you are trying to execute?&lt;br/&gt;&lt;br/&gt;I also wanted to let you know that we have now implemented sub-queries in SELECT fields, so your original SQL statement will work in the next version of LogViewPlus (v3.0.23 or greater).&amp;nbsp; Thanks for highlighting this issue.&lt;br/&gt;</description><pubDate>Mon, 09 Oct 2023 18:18:21 GMT</pubDate><dc:creator>LogViewPlus Support</dc:creator></item><item><title>RE: impossible to create a select query with sub select ?</title><link>https://www.logviewplus.com/forum/post/1868</link><description>Sorry, i've the following error now : Error in ROUND: 100.0 is not a valid value for Double.</description><pubDate>Mon, 09 Oct 2023 09:22:18 GMT</pubDate><dc:creator>DL9442</dc:creator></item><item><title>RE: impossible to create a select query with sub select ?</title><link>https://www.logviewplus.com/forum/post/1866</link><description>That's a good solution - thanks for sharing.&amp;nbsp;&amp;nbsp;&lt;br/&gt;&lt;br/&gt;To calculate the percentage, you can try:&lt;br/&gt;[code language="sql"]SELECT nbabovetime,total, CAST(ROUND(100.0 * (nbabovetime / total), 2) AS DECIMAL) as Percent&lt;br/&gt;FROM(&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SELECT sum(isrequestabovetime) as nbabovetime , count(*) as total &lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FROM (&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SELECT CASE WHEN time-taken &amp;gt; 1000 THEN 1 ELSE 0 END AS isrequestabovetime,cs-uri FROM CurrentView WHERE cs-uri LIKE '%/suite/sites/cpr%'&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;br/&gt;);[/code]&lt;br/&gt;&lt;br/&gt;Hope that helps,&lt;br/&gt;&lt;br/&gt;Toby</description><pubDate>Fri, 06 Oct 2023 14:48:08 GMT</pubDate><dc:creator>LogViewPlus Support</dc:creator></item><item><title>RE: impossible to create a select query with sub select ?</title><link>https://www.logviewplus.com/forum/post/1864</link><description>Thanks for the tips .... i've finally achieved my goal with the following query&amp;nbsp;&lt;br/&gt;&lt;br/&gt;SELECT  nbabovetime,total&amp;nbsp; FROM(&lt;br/&gt;SELECT sum(isrequestabovetime)&amp;nbsp;as nbabovetime , count(*) as total FROM (SELECT&amp;nbsp;CASE WHEN time-taken &amp;gt; 1000 THEN 1 ELSE 0 END AS isrequestabovetime,cs-uri FROM CurrentView WHERE cs-uri LIKE '%/suite/sites/cpr%') );&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Any clue to get the percentage at the end ?&amp;nbsp; (nbabovetime/total)*100 is not accepted&amp;nbsp;&lt;br/&gt;&lt;br/&gt;&amp;nbsp;</description><pubDate>Fri, 06 Oct 2023 11:56:30 GMT</pubDate><dc:creator>DL9442</dc:creator></item><item><title>RE: impossible to create a select query with sub select ?</title><link>https://www.logviewplus.com/forum/post/1863</link><description>Hi,&lt;br/&gt;&lt;br/&gt;Thanks for reaching out.&amp;nbsp; I think the problem here is that the LogViewPlus query engine does not support an embedded SQL statement as a field for a SELECT clause.&lt;br/&gt;&lt;br/&gt;However, I think you can achieve a similar result with something like:&lt;br/&gt;&lt;br/&gt;[code language="sql"]SELECT &lt;br/&gt;    'bigger than 3sec',&amp;nbsp;&lt;br/&gt;    SUM(CASE WHEN time-taken &amp;gt; 3000 THEN 1 ELSE 0 END) AS nbrequestbelowtime,&lt;br/&gt;    COUNT(*) AS total&lt;br/&gt;FROM CurrentView&lt;br/&gt;WHERE cs-uri LIKE '%/suite/sites/cpr%' &lt;br/&gt;GROUP BY&amp;nbsp;cs-uri;[/code]&lt;br/&gt;I have not tested that, but I think it should be close to what you are looking for.&lt;br/&gt;&lt;br/&gt;Hope that helps,&lt;br/&gt;&lt;br/&gt;Toby</description><pubDate>Fri, 06 Oct 2023 10:11:02 GMT</pubDate><dc:creator>LogViewPlus Support</dc:creator></item></channel></rss>