Multiple functions calling a same function. I need to create a flag. Suppose I have 4 functions(f1,f2,f3 and f4) in a PLSQL package. F1 is being called by F2,F3 and F4. All I want a flag in order to track which function call the F1. For example . If f2 called f1 then flag=2,flag=3 when f3 called f1 and so
Get DateTime from text
How to separate and display only the DateTime from the string? I have a column that holds this data: I used this query to separate out the time: and it returned the same lines. String didn’t get filtered When I tried using this statement: I got this error Conversion failed when converting date and/or ti…
trigger created but when executed showing some errors==> ORA-04091:, ORA-06512:, ORA-04088:
I have a table called movie_cast. This table already has duplicate values(#114). act_id, mov_id are foreign keys. And I’ve created a trigger on movie_cast table called trg1. Although the trigger is been created but after execution it shows some errors My task is: I want to allow entries in this table i.…
How to fetch all rows where an array contains any of the fields array elements
I have a table that has a column video_ids, it is of a bigint[] type. I would like to find all the rows that have any of the elements from the array passed in a select statement. So, if I have a row that has a video_ids field that looks like this: I would like to fetch it if I
Sql function find date difference between two consecutive rows per group
I am working on clinical data to find total sessions for patients by finding date difference. I can achieve this using Python but power bi does not support that script. So I needed help to do this in SQL. I am basic level user of SQL so have no idea how to start for this. Below is raw data PatientID
How to get double value with SqlDataReader
I’m trying read data from sql database. When I run the code, it gives an error when it comes to where it should read data. “System.InvalidCastException: Specified cast is not valid.” I get …
SQL to generate %, n and N from the datatable
I seek your help in generating a summary query result as %, n (numerator), and N (Denominator) out of a variable in the dataset for each underlying category: e.g: data sr.no. is_healthy 1 yes 2 no 3 yes 4 no 5 yes 6 yes 7 no 8 yes 9 no 10 yes I expect the following as a summary result
Remove “” from string or in SQL varchar
Is it even possible to return value of string without the ” ” ? I have the following string: Chb = “NOT”; Now i either want to remove the “” in C# or SQL. so i want to have either Chb = NOT in C# ,or i want to remove the ‘ ‘ in SQL that i get in @Chb
SQL Where clause order
I have this SQL query: It runs fine and displays the expected result without the WHERE line, but I do need to filter the resultant data as that would imply. The error I’m getting is Invalid Column Name ‘FileCount’ after the WHERE keyword. I’ve been reading around and I can’t find…
Create custom groups on columns and count another column in sql
I’m using sql server and I have a table named Table that looks like this. SenderId ReciverId ItemCount 1 2 5 1 4 3 1 6 4 2 1 2 2 5 6 3 1 1 4 3 7 4 5 4 5 2 6 5 4 2 5 6 6 6 4 3 I want to make groups of