
How can I filter words in SQL using a function?
How can I filter words in SQL using a function? I'm having a hard time if I explain it, so I'm giving an example: ID WebsiteName 1 www.yahoo.com 2 www.google.com 3 www.youtube.com What I want ...
sql - MySQL CREATE FUNCTION Syntax - Stack Overflow
Jul 19, 2011 · I am trying to create a function in MySQL: Here is the SQL code: CREATE FUNCTION F_Dist3D (x1 decimal, y1 decimal) RETURNS decimal DETERMINISTIC BEGIN DECLARE dist decimal; SET dist = SQRT(x1...
How can I create a function in SQL with 2 parameters?
Sep 3, 2018 · I'm trying to create a function that SUMs the total number of minutes of actual duration for videos with a Finished status given a UserID as a parameter. This is what I have so far but I can't figu...
sql - Can I create a One-Time-Use Function in a Script or Stored ...
May 26, 2017 · In SQL Server 2005, is there a concept of a one-time-use, or local function declared inside of a SQL script or Stored Procedure? I'd like to abstract away some complexity in a script I'm writing, but it would require being able to declare a function. Just curious.
How to return varchar value from a function - Stack Overflow
Oct 15, 2015 · I written the following function. SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO Create FUNCTION NameFunction ( @eid int ) RETURNS varchar AS BEGIN Declare @logid varchar(50); SELECT @logid = E.LoginId from HumanResources.Employee As E where E.BusinessEntityID = @eid RETURN @logid END GO When I am executing it is showing result as a.
How can I create a SQL function with a parameter?
Nov 18, 2015 · How can I create a SQL function out of this so that I can pass in whatever number (instead of 28) and the function would return whatever the result of that select turns out to be? I tried creating one but I keep getting compilation errors. Current SQL to create function create or replace function "DT_SERVICE_STRING" (id in VARCHAR2) return ...
MySQL, create a simple function - Stack Overflow
Jun 2, 2016 · I want to create a simple MySQL function, I have this MySQL procedure: CREATE PROCEDURE getUser(gU INT) SELECT * FROM Company WHERE id_number = gU; CALL getUser(2); I need some help making this into a MySQL function. What are the pros and cons of using a function over a procedure?
How to create a function SQL that returns a string from a table?
Aug 19, 2017 · EDIT: A function really isn't appropriate for this. Probably the best solution is a computed column: alter table t add something as (concat('resultado: ', num_notificacao, ';', num_multa); Then you can get the value directly from the table. In earlier versions of SQL Server, you would use a view rather than computed column.
sql - Create a function in PostgreSQL - Stack Overflow
Oct 11, 2021 · I am not sure how the CREATE FUNCTION statement works in PostgreSQL. I want to define a function (just for entertainment) such that given a number n, it prints asterisks starting from 1 up to n So I
How to create custom functions in SQLite - Stack Overflow
Jan 21, 2010 · Note that: "Custom SQL functions created in SQLiteStudio exist only in context of SQLiteStudio. Functions are not persisted in database, it's just not how SQLite databases work.