Skip to content

Tag: sql-function

Replace function in SQL Server

I have a string of data I am trying to use the replace function to replace double commas with NULL values Solution But I keep ending up with (The ,,, needs to become ,NULL,NULL, but only becomes ,NULL,,) Here is my sample code I’m using Answer If you do the same replacement twice, any number of sequenti…

ORACLE SQL How to use custom function iside insert cte

I am trying to use function inside insert SQL, but I am getting error ORA-32034. Looks like that I couldn’t access this function in the cte. Maybe someone can help? Answer If the query containing the PL/SQL declaration section is not the top level query, the top-level query must include the WITH_PLSQL h…

Average of Sum minus Minimum

I have an SQL statement that grabs the grades of different activity types (Homework, Quiz, etc), and if there’s a drop lowest for that type, it drops, else, it remains. The errors are below as well as the SQL Code. Here are the errors I’m getting: Answer Look into analytical functions. (SO questio…