Skip to content

Tag: sql

pl/SQL for loop

i having an issue on changing the month according to the loop in where the clause i have used between function the month of todate function have to be changed according to the loop if a becomes 1 then the month in where clause has to be changed according to 1 if a becomes 2 the month have be changed

Oracle SQL Trigger not getting created

I have a table passenger as shown below I am learning triggers and I want to create a trigger that updates charges as charges + 100 before a new insert is done. Here is the trigger I created. However, I am getting the error ORA-04079: invalid trigger specification. I have tried replacing new with :new, adding…

Can’t remove duplicates from MariaDB 10

I’m having hard time removing duplicates from database. It’s MariaDB (protocol version: 10, 10.3.34-MariaDB Server). I need to remove rows where three columns are equal. I was trying to use WITH clause but database throws error that it can’t recognize ‘WITH’, so I focused on trad…

selecting columns which are NOT of a specific type SQL

I want to select all the columns in BigQuery that are not of the type “TIMESTAMP”. I have written the query which returns such columns which is: But I am struggling to return data from only these columns in SQL, I have tried the following query which results in “Scalar subquery produced more…

SSRS display text when image column is null

I’m trying to build a SSRS report that shows player name and their photos (if there is any). How do I display a text e.g.”No image” if image column return null value (or empty)? I’ve tried to do this in SSRS report itself but no luck : Any help is appreciated. Answer Assuming you get t…

How to apply max function in a join query?

I am new to SQL Server, I have 3 tables consider an employee table empid name location 1 abc USA 2 efg UK Another table named location-table location holidaycode uk uk1 usa usa1 And also holidaytable: holiday-code date type uk1 2022-01-01 LM uk1 2022-01-01 RMC Expected result is: empid location holidaycode da…