Skip to content

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…

how to insert data using trigger

I got question about using trigger to insert data, for instance, I do have two tables, and second table has attributes and records with table, except additional two attributes, like below: CREATE …

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…

Case statement in where clause oracle

In where clause i have two option 1) status = ‘N’ and type = ‘1’ and 2) status = ‘Y’ and type = ‘1’ based on parameter I need execute one option: where case when (carName = :…

How to verify if array list is empty in SQL

I have a multilist field returning a list of values. My query is filtering the list using IN (list), but if the user do not select anything is list, it returns an empty list, or null (I can’t see). …

Postgres FOR loop syntax error at or near

I’m trying to write rows into an array from table_a and table_b and insert it into a table. This is my function def: CREATE OR REPLACE FUNCTION format() RETURNS void LANGUAGE ‘sql’ VOLATILE COST 100 …