Skip to content

Tag: sql

SQLite query to find datetime difference between multiple rows

Here are my two tables’ structures in SQLite if startJob is 1 it implies that the employee is starting the job and if startJob is 0 it means employee is stopping the job. attendanceTable is sorted by mydate column I want output as worked hour by individual employees. Input of query can be two different …

Postgresql column reference is ambiguous

I want to call my function but I get this error: ERROR: column reference “list” is ambiguous LINE 3: SET list = ARRAY_APPEND(list, input_list2), the error is on the second list inside array_append function. My function: Answer You have to use the alias name in the insert query because list has two…

MySQL match a value with wildcard in multiple columns

I have a teachers table that looks like this: teacherid teacherfname teacherlname salary 1 Alexander Bennett 55.30 I would like to return any record that contains a given string in the teacherfname, teacherlname and salary columns. What I have right now (this returns exact match only): What I would like to do…

SQL UPDATE SET SELECT slow [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 7 months ago. Improve this question I ha…