<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[My Visual Database — SQL queries]]></title>
		<link>https://myvisualdatabase.com/forum/index.php</link>
		<atom:link href="https://myvisualdatabase.com/forum/extern.php?action=feed&amp;fid=4&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent topics at My Visual Database.]]></description>
		<lastBuildDate>Tue, 24 Feb 2026 15:08:00 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[SQL Query]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?id=9504&amp;action=new</link>
			<description><![CDATA[<p>I have a table (Cassa) with the fields <br />(Giorno, Cifra, record_count, id_Nuova_Causale, Anno). <br />I need to select all the records in the table with the value <br />Anno = 2025 <br />and display the updated TableGrid1 with only those values. <br />I&#039;ve tried everything, but it doesn&#039;t work. <br />Can someone give me an example of how to write the script? Thanks.</p>]]></description>
			<author><![CDATA[null@example.com (Ansel)]]></author>
			<pubDate>Tue, 24 Feb 2026 15:08:00 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?id=9504&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[SQL Reset/Delete]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?id=9498&amp;action=new</link>
			<description><![CDATA[<p>Hi. How can I delete all records in a table and reset the ID whitout delete table?</p>]]></description>
			<author><![CDATA[null@example.com (Ansel)]]></author>
			<pubDate>Thu, 19 Feb 2026 14:38:31 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?id=9498&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Batch Update Multiple Textboxs]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?id=9346&amp;action=new</link>
			<description><![CDATA[<p>I need a bit of help with creating a Batch Update Textbox, I need to filter locations and then have the textbox text value sent to all selected items via apply Link button. I have put together a quick sample to make it easier to understand on what I am trying to accomplish. also if any one could offer any advise on my report format, notes and screenshot in application.<br />Thanks in advance :-)</p>]]></description>
			<author><![CDATA[null@example.com (Just4Fun)]]></author>
			<pubDate>Mon, 29 Sep 2025 14:26:43 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?id=9346&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[FooterValue]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?id=9288&amp;action=new</link>
			<description><![CDATA[<p>please help me fix this procedure, to generate column 6 footer value from last ROW column 6 value<br /></p><div class="codebox"><pre><code>procedure FrmBukuBesar_TableGrid1_OnChange(Sender: TObject);
var
  i: Integer;
  Debet, Kredit, Hasil: double;
begin
  // Format dan hitung total untuk kolom Debet dan Kredit
  for i := 4 to 5 do
  begin
    if FrmBukuBesar.TableGrid1.Columns[i] is TNxNumberColumn then
    begin
      with TNxNumberColumn(FrmBukuBesar.TableGrid1.Columns[i]) do
      begin
        FormatMask := &#039;###,##0&#039;;
        Footer.FormatMask := &#039;###,##0&#039;;
        Footer.FormulaKind := fkSum;
        FrmBukuBesar.TableGrid1.CalculateFooter;
        end;
    end;
  end;

  // Hitung saldo akhir = Debet - Kredit
  //Debet := FrmBukuBesar.TableGrid1.Columns[4].Footer.FormulaValue;
  //Kredit := FrmBukuBesar.TableGrid1.Columns[5].Footer.FormulaValue;
  //Hasil  := Debet - kredit;
  //FrmBukuBesar.TableGrid1.Columns[6].Footer.Caption := FloatToStr(Hasil);

  with TNxNumberColumn(FrmBukuBesar.TableGrid1.Columns[6]) do
  begin
    FormatMask := &#039;###,##0&#039;;
    Footer.FormatMask := &#039;###,##0&#039;;
    Footer.FormulaKind := fkNone;
    Footer.FormulaValue := Debet - Kredit;
  end;

  // Kalkulasi ulang footer dan sembunyikan kolom ke-7
  FrmBukuBesar.Edit1.Value := Debet;

  FrmBukuBesar.TableGrid1.CalculateFooter;
  FrmBukuBesar.TableGrid1.Columns[7].Visible := False;
end;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (agusecc)]]></author>
			<pubDate>Mon, 16 Jun 2025 03:00:42 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?id=9288&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[How To Concat Ling Break On SQLite]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?id=9214&amp;action=new</link>
			<description><![CDATA[<p>How to Edit Script&nbsp; Insert Line Break On SQLite ?<br />Code<br /></p><div class="codebox"><pre><code>SELECT &#039;A&#039;||&#039;\n&#039;||&#039;B&#039;</code></pre></div><p>Response<br /></p><div class="codebox"><pre><code>A\nB</code></pre></div><p>----------</p><br /><p>Code<br /></p><div class="codebox"><pre><code>SELECT &#039;A&#039;||&#039;\r&#039;||&#039;B&#039;</code></pre></div><p>Response<br /></p><div class="codebox"><pre><code>A\rB</code></pre></div><p>----------</p><br /><p>Code<br /></p><div class="codebox"><pre><code>SELECT &#039;A&#039;||&#039;\r\n&#039;||&#039;B&#039;</code></pre></div><p>Response<br /></p><div class="codebox"><pre><code>A\r\nB</code></pre></div><p>----------</p><br /><p>Code<br /></p><div class="codebox"><pre><code>SELECT &#039;A&#039;||char(10)||&#039;B&#039;</code></pre></div><p>Response<br /></p><div class="codebox"><pre><code>[Err] 1 - no such function: char</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (prahousefamily)]]></author>
			<pubDate>Thu, 27 Mar 2025 03:51:30 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?id=9214&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Отрицательное значение в Вычисляемом поле]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?id=9210&amp;action=new</link>
			<description><![CDATA[<p>Здравствуйте, помогите исправить ошибку при заполнении Вычисляемого поля.<br />Необходимо, при отрицательном значении вывести текст или ноль.</p><p>Ошибка<br /></p><div class="codebox"><pre><code>select case when value &lt; 0 then &#039;нет данных&#039; when value &gt; 0 then (tb_forma.stiomost-((DATEDIFF(CURRENT_DATE,forma_user.forma_data)+1)*tb_forma.summa)) end</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Новичок)]]></author>
			<pubDate>Sat, 22 Mar 2025 19:44:36 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?id=9210&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[I have problem sql query displays empty id in tablegrid]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?id=9108&amp;action=new</link>
			<description><![CDATA[<p>anyone can help me? <br />I have problem sql query displays empty id in tablegrid on my aplcation when i search between datetimepicker1&nbsp; and datetimepicker2 at Laporan Absensi</p><p>there are my script<br /></p><div class="codebox"><pre><code>select distinct 
(select employees.id from employees where employees.id = attendancedays.id_employees AND attendancedays.date &gt;= {datetimepicker1} and  attendancedays.date &lt;= {datetimepicker2} ) as  id,                                 

(select  trim(
ifnull(firstname||&#039; &#039;,&#039;&#039;)||       
ifnull(lastname,&#039;&#039;)
)     from employees where employees.id = attendancedays.id_employees AND attendancedays.date &gt;= {datetimepicker1} and  attendancedays.date &lt;= {datetimepicker2} ) as Nama,                                 
(select  jabatan from jabatan where jabatan.id = employees.id_jabatan AND attendancedays.date &gt;= {datetimepicker1} and  attendancedays.date &lt;= {datetimepicker2}  ) as Jabatan,
(select  unitkerja from unitkerja where unitkerja.id = employees.id_unitkerja AND attendancedays.date &gt;= {datetimepicker1} and  attendancedays.date &lt;= {datetimepicker2}  ) as UnitKerja,
(select  romawi from unitkerja where unitkerja.id = employees.id_unitkerja AND attendancedays.date &gt;= {datetimepicker1} and  attendancedays.date &lt;= {datetimepicker2}  ) as romawi,
(select  harikerja from attendancedays where employees.id = attendancedays.id_employees AND attendancedays.date &gt;= {datetimepicker1} and  attendancedays.date &lt;= {datetimepicker2}  ) as HariKerja,
(select sum (hadir) from attendancedays where employees.id = attendancedays.id_employees AND attendancedays.date &gt;= {datetimepicker1} and  attendancedays.date &lt;= {datetimepicker2}  ) as Hadir,
(select sum (alpha) from attendancedays where employees.id = attendancedays.id_employees AND attendancedays.date &gt;= {datetimepicker1} and  attendancedays.date &lt;= {datetimepicker2} ) as Alpha,
(select sum (sakit) from attendancedays where employees.id = attendancedays.id_employees AND attendancedays.date &gt;= {datetimepicker1} and  attendancedays.date &lt;= {datetimepicker2}  ) as sakit,
(select sum (ijincuti) from attendancedays where employees.id = attendancedays.id_employees AND attendancedays.date &gt;= {datetimepicker1} and  attendancedays.date &lt;= {datetimepicker2}   ) as Ijin_Cuti, 
(select sum (terlambat) from attendancedays where employees.id = attendancedays.id_employees AND attendancedays.date &gt;= {datetimepicker1} and  attendancedays.date &lt;= {datetimepicker2} ) as Terlambat,
(select sum (sanksiapel) from attendancedays where employees.id = attendancedays.id_employees AND attendancedays.date &gt;= {datetimepicker1} and  attendancedays.date &lt;= {datetimepicker2} ) as SanksiApel,
(select sum (lembur) from attendancedays where employees.id = attendancedays.id_employees AND attendancedays.date &gt;= {datetimepicker1} and  attendancedays.date &lt;= {datetimepicker2} ) as Lembur


from attendancedays
left outer join employees on attendancedays.id_employees = employees.id    
left outer join unitkerja on employees.id_unitkerja = unitkerja.id    

order by  unitkerja.id asc                                                                               
                                                                                                  
  </code></pre></div><p>this is the link app :<br /><a href="https://www.mediafire.com/file/0e1neg101ovpwth/App+Penggajian+7.rar/file">https://www.mediafire.com/file/0e1neg10 … 7.rar/file</a></p>]]></description>
			<author><![CDATA[null@example.com (agusecc)]]></author>
			<pubDate>Fri, 15 Nov 2024 09:00:38 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?id=9108&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[SQL filter passed 30 days.]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?id=9103&amp;action=new</link>
			<description><![CDATA[<p>Hi Everybody</p><p>I&#039;m attempting to generate a report from a GRID which will automatically (by opening the form willclick a button, starting the sql)&nbsp; list all clients that are passed 30 days.</p><p>Here is what i managed to develop, but it still doesn&#039;t work.</p><p>&nbsp; &nbsp; &nbsp;SELECT&nbsp; &nbsp; &nbsp;Sipad,Namecombined,date30days&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp;From&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ClientDbf&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp;WHERE&nbsp; &nbsp; &nbsp;DATE(date30days) &gt; DATE((&#039;now&#039;, &#039;-30 days&#039;);&nbsp; &nbsp;</p><br /><p>Any tips ? </p><p>Also I did manage to attempt something that didn&#039;t work, and ended up getting the date columb in the grid with hours 00:00:00&nbsp; is there something in the SQL script i must do to truncate it to only the date ?</p><p>Tks.</p><p>jeff</p>]]></description>
			<author><![CDATA[null@example.com (jeffmtl@hotmail.com)]]></author>
			<pubDate>Sat, 02 Nov 2024 22:10:26 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?id=9103&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[SQL query for numerical values]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?id=9089&amp;action=new</link>
			<description><![CDATA[<p>Greetings to all. I have a button with SQL query. The problem is when to specify a search on a field with numbers.</p><div class="codebox"><pre><code>WHERE                                            
    (
        ({Edit3} = &#039;&#039; OR PReg.PSum &gt;= {Edit3}) AND
        ({Edit4} = &#039;&#039; OR PReg.PSum &lt;= {Edit4})
    )</code></pre></div><p>constant error that the syntax is not valid for MySQL.</p><p>i tried<br /></p><div class="codebox"><pre><code>(
        (IFNULL({Edit3}, &#039;&#039;) = &#039;&#039; OR PReg.PSum &gt;= IFNULL({Edit3}, 0))
        AND 
        (IFNULL({Edit4}, &#039;&#039;) = &#039;&#039; OR PReg.PSum &lt;= IFNULL({Edit4}, 999999999999))
    )</code></pre></div><p>but the same thing.</p><p>Maybe someone has an example of a SQL query using a request for numeric (more and/or less), dates (more and/or less), checkboxes. Because when I don&#039;t have certain fields filled in on the search form, the request gives a constant error about incorrect syntax.</p><p>Or maybe it is better to do it through a script in the program to additionally control the conditions. But how is it correct to edit the selected record after filling the table?</p>]]></description>
			<author><![CDATA[null@example.com (Step-in)]]></author>
			<pubDate>Fri, 11 Oct 2024 07:17:54 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?id=9089&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Update Database column between two dates]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?id=9086&amp;action=new</link>
			<description><![CDATA[<p>Hi Everybody</p><p>I&#039;m a beginner in scripting and attempted to find the answer in the form but might not have had the vocabulary to getting about finding what I wanted.</p><p>I am working with a waiting list for clients such that I need to update the whole database of how many days people have been waiting.</p><p>An initial date has been entered when a request was made, but unless I enter in each file manually and save the database will not update how many days the client is waiting.</p><p>I am use this script when I enter the form (Onshow) and when I click the Save button to update the table.</p><p>VAR<br />&nbsp; &nbsp; // Calculate number of days client on waiting list.<br />&nbsp; &nbsp; i : integer;<br />&nbsp; &nbsp; iDays: integer;<br />&nbsp; &nbsp; start, stop: integer;</p><p>Begin&nbsp; &nbsp; // Calculate the number of days client is on waiting list.<br />&nbsp; &nbsp; if ClientCreate.DateAssigned.Checked = false&nbsp; then<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;begin<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; iDays := 0;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; start := Trunc (ClientCreate.DateDiscipline.date);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stop := Trunc (date);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for i := start to stop do<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Inc(iDays);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Begin<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ClientCreate.ClientDaysWaiting.Value := iDays;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end;</p><br /><p>I would like to have a script that upon entering the main menu, the table for all the clients is updated automatically.</p><p>Any help would be greatly appreicated.</p><p>Tks.<br />Jeff</p>]]></description>
			<author><![CDATA[null@example.com (jeffmtl@hotmail.com)]]></author>
			<pubDate>Tue, 08 Oct 2024 10:06:06 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?id=9086&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[I need script query sum for  (Real)]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?id=9084&amp;action=new</link>
			<description><![CDATA[<p>I try use sql query sum for Real NOT Integer&nbsp; &nbsp;but can&#039;t display in table grid.&nbsp; anyone please help me..<br /></p><div class="codebox"><pre><code>(select sum (Real) from attendancedays where employees.id = attendancedays.id_employees ) as Terlambat</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (agusecc)]]></author>
			<pubDate>Tue, 08 Oct 2024 03:34:42 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?id=9084&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[I need new webGrid]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?id=9058&amp;action=new</link>
			<description><![CDATA[<p>I need I need new webGrid</p><p>I think the previous version has a problem (Bug)</p>]]></description>
			<author><![CDATA[null@example.com (mouasomar)]]></author>
			<pubDate>Wed, 11 Sep 2024 23:23:11 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?id=9058&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[use XAMPP to connect MVDB (server)]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?id=9050&amp;action=new</link>
			<description><![CDATA[<p>Experts, please&nbsp; can use XAMPP to connect MVDB (server)?<br />how</p>]]></description>
			<author><![CDATA[null@example.com (mouasomar)]]></author>
			<pubDate>Mon, 09 Sep 2024 20:34:31 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?id=9050&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Viewing sqlite view of an MVD project on mobile]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?id=8996&amp;action=new</link>
			<description><![CDATA[<p>Sharing: after searching the Play Store, I found the Filex application (freeware), which reads sqlite files (the best I found). I wanted to access a project&#039;s sqlite.db, run queries, and save them for future use. I came to the conclusion that it would be faster to create views in sqlite.db using, for example, Sqlite Expert Personal (freeware), than to create a query directly in Filex. Then, with the help of ChatGPT, I generated the views. Below is an example of a view script and a screen with the data displayed by the view, which is the same as what Filex shows on a cell phone. Just copy the sqlite.db to a folder on your phone. It&#039;s not the best of all worlds, but it&#039;s a simple way to have synthetic analytical information from an MVD project on your cell phone!</p><br /><div class="codebox"><pre><code>WITH
  [subquery] AS(
    SELECT 
           STRFTIME (&quot;%Y&quot;, [data]) AS [ano], 
           [lancamento_all_view].[id_tipo_operacao], 
           CASE WHEN [lancamento_all_view].[id_tipo_operacao] = 1 THEN &quot;Receitas&quot; ELSE &quot;Despesas&quot; END AS &quot;Operacao&quot;, 
           [lancamento_all_view].[id_categoria], 
           [lancamento_all_view].[categoria], 
           CASE WHEN [id_tipo_operacao] = 1 THEN SUM ([entrada] - [saida]) ELSE SUM ([saida] - [entrada]) END AS [valor]
    FROM   [lancamento_all_view]
    WHERE  [lancamento_all_view].[id_categoria] &lt;&gt; 0
             AND [lancamento_all_view].[ocultar_mining] = 0
    GROUP  BY
              [lancamento_all_view].[id_tipo_operacao], 
              [lancamento_all_view].[categoria], 
              [ano]
  ),
  [category_totals] AS(
    SELECT 
           [categoria], 
           SUM ([valor]) AS [total_valor_categoria]
    FROM   [subquery]
    GROUP  BY [categoria]
  ),
  [cumulative_totals] AS(
    SELECT 
           [a].[ano], 
           [a].[id_tipo_operacao], 
           [a].[Operacao], 
           [a].[categoria], 
           [a].[valor], 
           (SELECT SUM ([b].[valor])
           FROM   [subquery] [b]
           WHERE  [b].[categoria] = [a].[categoria]
                    AND [b].[ano] &lt;= [a].[ano]) AS [acumulado]
    FROM   [subquery] [a]
  ),
  [total_receitas] AS(
    SELECT 
           NULL AS [ano], 
           &quot;Total Receitas&quot; AS [Operacao], 
           NULL AS [categoria], 
           SUM ([valor]) AS [valor], 
           SUM ([valor]) AS [acumulado], 
           NULL AS [part%], 
           NULL AS [mini_grafico]
    FROM   [subquery]
    WHERE  [id_tipo_operacao] = 1
  ),
  [total_despesas] AS(
    SELECT 
           NULL AS [ano], 
           &quot;Total Despesas&quot; AS [Operacao], 
           NULL AS [categoria], 
           SUM ([valor]) AS [valor], 
           SUM ([valor]) AS [acumulado], 
           NULL AS [part%], 
           NULL AS [mini_grafico]
    FROM   [subquery]
    WHERE  [id_tipo_operacao] = 2
  ),
  [main_query] AS(
    SELECT 
           [subquery].[ano], 
           [subquery].[Operacao], 
           [subquery].[categoria], 
           PRINTF (&#039;%.2f&#039;, [subquery].[valor]) AS [valor], 
           PRINTF (&#039;%.2f&#039;, [cumulative_totals].[acumulado]) AS [acumulado], 
           PRINTF (&#039;%.2f&#039;, ([subquery].[valor] / [category_totals].[total_valor_categoria]) * 100) AS [part%], 
           SUBSTR (&#039;██████████████████████████████████████████████████████&#039;, 1, ROUND (([subquery].[valor] / [category_totals].[total_valor_categoria]) * 50)) || &quot; (&quot; || [subquery].[id_categoria] || &quot;)&quot; AS [mini_grafico], 
           [subquery].[id_categoria]
    FROM   [subquery]
           JOIN [category_totals] ON [subquery].[categoria] = [category_totals].[categoria]
           JOIN [cumulative_totals] ON [subquery].[ano] = [cumulative_totals].[ano]
                AND [subquery].[categoria] = [cumulative_totals].[categoria]
                AND [subquery].[id_tipo_operacao] = [cumulative_totals].[id_tipo_operacao]
  ),
  [blank_lines] AS(
    SELECT DISTINCT 
                    NULL AS [ano], 
                    NULL AS [Operacao], 
                    [categoria], 
                    NULL AS [valor], 
                    NULL AS [acumulado], 
                    NULL AS [part%], 
                    NULL AS [mini_grafico], 
                    [id_categoria]
    FROM   [main_query]
  )
SELECT 
       [ano], 
       [Operacao], 
       [categoria], 
       [valor], 
       [acumulado], 
       [part%], 
       [mini_grafico]
FROM   (SELECT 
               [ano], 
               [Operacao], 
               [categoria], 
               [valor], 
               [acumulado], 
               [part%], 
               [mini_grafico], 
               [id_categoria], 
               0 AS [sort_order]
        FROM   [main_query]
        UNION ALL
        SELECT 
               &#039;***********&#039; AS [ano], 
               &#039;***********&#039; AS [Operacao], 
               &#039;***********&#039; AS [categoria], 
               &#039;***********&#039; AS [valor], 
               &#039;***********&#039; AS [acumulado], 
               &#039;***********&#039; AS [part%], 
               &#039;***********&#039; AS [mini_grafico], 
               [id_categoria], 
               1 AS [sort_order]
        FROM   [blank_lines])
ORDER  BY
          [id_categoria],
          [sort_order],
          [ano],
          [Operacao]</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (jrga)]]></author>
			<pubDate>Tue, 16 Jul 2024 15:19:51 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?id=8996&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Why one Query works in mvd but not in SqliteStudio?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?id=8951&amp;action=new</link>
			<description><![CDATA[<p>This query works in MVD.</p><p>@derek</p><p>select total(quantity) from transactions where transactions.id_products = products.id and quantity &gt; 0<br />why no joins?</p><p>tables join auto in MVD so you guys write only some sql<br />if so<br />how I know which joins or pre provided query in MVD?</p><p>[17:25:06] Error while executing SQL query on database &#039;sqlite0&#039;: no such column: products.id</p><p>So I was learning sql - found join with group by</p><p>This works in SqliteStudio</p><p>SELECT products.id, products.name, SUM(transactions.quantity) AS total_quantity<br />FROM transactions<br />JOIN products ON transactions.id_products = products.id<br />WHERE transactions.quantity &gt; 0<br />GROUP BY products.id, products.name;</p><p>Explain why?</p>]]></description>
			<author><![CDATA[null@example.com (kavinacomputers)]]></author>
			<pubDate>Thu, 16 May 2024 12:09:23 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?id=8951&amp;action=new</guid>
		</item>
	</channel>
</rss>
