Skip to content

Conditional removing duplicate records

I’m storing some realtime data in SQLite. Now, I want to remove duplicate records to reduce data and enlarge its timeframe to 20 seconds by SQL commands. Sample data: id t col1 col2 –…

Getting data from three tables in postgresql

I’m new to postgresql. I have three tables Table1: teacher Table2: school_location Table3: teachers_school_location I want to write a query to get data from these three tables like this: (output in json by calling an API) When user select tid = 1, I want output like this When user select tid = 2, I want…

SQL Between Dates as an Object [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question I’m trying to get only the dates between 2018 and 2020 but still get 2017… not su…

Sql string with OLEDB gives error 1004 in VBA

I would like to import a text file into excel filtering just what I want through a VBA macro. When I use LIKE operator in the sql string I get the error 1004. I have tried both * and % as wildcard and ALike instead of Like but there is no difference. test_7.txt and the macro is: Answer SQL statements

Unexpected token when creating a string expression?

I have the following code: There is an error here ‘{cardId And it tells me Invalid Expression term ” Answer You need to be aware that this kind of string concatenation is avoided and it is open to SQL Injection attack, you should always use parameterized queries to avoid SQL Injection and also to …

Retrieve data from two different rows in a single SQL query?

I’ve a table with the following data and I need to find the number of minutes between two jobs (Say A and C). The following query works but wondering, if there is a simpler way to achieve the same. Goal is to achieve, the difference between start time and end time of two jobs. Answer I can interpret you…