I want to convert type date unix to timestamp in Informix. My column date1 contains values as 1598915961, 1598911249, 1598911255… expected output: 2020-02-13 15:00:00 How should I do it, please?
How to implement AFTER INSERT Trigger in Oracle PL/SQL?
I am trying to implement after insert trigger in PLSQL. The goal is to check if there are multiple (>1) rows having specific status for each client. If so I’d like to rise an exception and roll …
Get most common value in column [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 2 years ago. Improve this question I have next table: How I can get most common (common means that the count of 2 is 3, count o…
Laravel 5.6.9 – database count gives different outputs
Does anyone know why these two ways to count numbers of users in my table give different answers when i run them in tinker? AppModelsUser::count() => 92269 $count = DB::table(‘users’)->count() => 92829 Running a SQL query in Sequel Pro gives 92829. Answer If you have the SoftDelete trait …
SQL – get summary of differences vs previous month
I have a table similar to this one: It contains the stores that are active at BOM (beginning of month). How do I query it to get the amount of stores that are new that month – those that where not active the previous month? The output should be this: I now how to count the first time that each
Using WITH and subset in CASE construction
Greetings to senior colleagues. I got caught up in this thing. It is necessary to substitute the corresponding values in the CASE when the construction depending on the state of the load_date field. The problem is that the second was assigned a value to the mean_v field based on the calculation of the average…
How to structure limited voting system design
I have 3 types of tables. Categories, Candidates, Voters. To be describing the problem as short as possible, Candidates can belong to only 1 category. Voters can vote for each category and only one …
Assign Unique Group Id To Sets of Rows with Same Column Value Separated by Other value
I have some data that looks like this: What I want is for each group which has the same radius value to have its own unique id, for example: What I don’t want is the second group with radius 10 to have the same groupid as the first group (not 1). I’m working on SQL Server but the solution should
Count if the data is not unique
I have a table of store information describing which stores are linked with one another. The data might look like this: | store_id | link_num | linked_store | | 1 | 1 | 10 | | …
How to flat a subarray in Postgres?
select array[[1,2],[2,3]] Output: -[ RECORD 1 ]——– array | {{1,2},{2,3}} How do I flat the array, so I can then unnest? Expected {1, 2, 2, 3}