I am trying to write a quarry in a module for Dolibarr ERP. But module hase a part of code that is predefined and can not be changed. And I need to insert a SUM() function in it that will combine rows …
Tag: sql
How to count/increment the current number of occurances of a table column in a MS SQL select
I have a table which looks like this: id | name| fk_something —————- 0 | 25 | 3 1 | 25 | 2 2 | 23 | 1 and I want to add another column with a number which increments everytime row …
What should I use instead of sequence in order to avoid gaps?
I’m developing a system that allows to organise paper documents in folders. When folder is full, user hits ‘New folder’ button. This action calls nextval() of sequence of folders. Here is how this …
Need to select a value from table and store it into variable
Hello everyone I am currently working on some testing project and I am having a little problem. Using selenium, I need to SendKey in specific element but instead of fixed value i need to use value (…
SQL distinct values per group – how to “group by” and get a list of distinct values per group?
I need to do a bigquery/standard SQL statement (or a series of statements) that does “group by”, and returns a list of distinct values for each group (not count). for example for tables with headers …
Can i use SUBSTR() inside of CAST() method?
I have a table called cities, with a column for timezones ( Timezone VARCHAR(10) NOT NULL that has timezones stored like: +00:00 or -02:00). – I am trying to select all cities that are two hours behind a city belonging to the +02:00 timezone. I want to select the third character of the string and conver…
SQL query not showing the right result when using LIKE
I am using Microsoft SQL Server Management Studio 2018 for my queries and I am trying to get the total quantity of ‘Cavity’ part types for each order and I have notice some anomaly for 1 order. I am 99% sure that it has been properly added to the SQL database as each order is first created in Acce…
How to bring columns to a table from another table by the Id?
I have this tables People, Ticket, and Report. I would like to replace the ForeingKey idPeople with columns Name and Age from People table. In the Report table replace the Foreing Key idTicket with ticketCol2, Name, Age from the previous table Ticket with replaced columns (idPeople by Name, Age). And I the re…
For loop in Jinja2 splitting the chars in nested list, instead of returning whole of nested list
My doubts list is [[‘a’,’b’,’This is a sentence’]] My HTML (Jinja) is My Flask is :- x is giving a,b,T,h,i,s,i,s,a,s,e,n,t,e,n,c,e [Each char one iteration] I expected a,b,This is a sentence. [Only one iteration] How do I resolve this? Thanks in advance! Answer You have dum…
Oracle APEX – Download hidden SQL query into CSV
I am trying to create a button on a page in my application that will download the full table I am referencing as a CSV file. I cannot use interactive reports > actions > download CSV because the interactive reports have hidden columns. I need all columns to populate in the CSV file. Is there a way to cr…