I’m trying to get a specific document in mongodb and I’m using find(). the problem is that it doesn’t give me the result that I’m looking for in the html file (for example: i choose MALE and XL which …
How to select from a column with a list of ids in postgresql
I’ve got mytable1 with row_number integer and list_of_ids int[] column mytable2 with id integer and company text columns Example entry for mytable1 Example entry for mytable2 I need to feed back values from mytable2 into mytable1. This way the expected output would be Answer You need to unnest the lists…
getting output of union all without using union all
I have been given a situation to find the common record between 2 tables without using union. I could do it. But I am not able to do ‘union all’. I mean I have to find out output of 2 table including …
Group rows by dense_rank() and loop through each sub-group and compare another column in next row of that sub group?
I have tried the following in LINQPad: I want to write a query which will return only the IDs 1 and 2 (not 3 and 4) because: ID 1 – has more than 1 rows and startdate of its rownum 2 is 1 day ahead of enddate of its rownum 1 ID 2 – has more than 1 rows and
Converting seconds to time where seconds is greater than 24 hours in MySQL
I’m trying to get a real life time based on seconds, where the number of seconds can be greater than 86400 (which equals 24 hours++). So for example; If the seconds equals 90000 the result will be 25:…
Merging and counting 2 tables in SQL
I’ve been trying forever to find a suitable answer so I would really appreciate some help. I have 2 tables that I want to merge… Table1 contains airport/station data: id | name | country —-…
how to split a string in a column field value of a table to multiple rows in select query in postgresql
table1 ID ITEM ———————– 1 a|b|c 2 x|y|z 3 Q||S 4 |||| 5 J|K|Y|U I want to insert above ITEM to table2 as following manner table2 SLNO ID ITEMS —–…
How to query with a preference with LIKE?
I have this query, using Postgres: select * from jobs where short_name like ‘%GES.PAY%’ order by short_name; which returns this result : CRD.GES.PAY GES.PAY REL.GES.PAY But how to have ‘GES.PAY’ the …
Recursive CTE have performace issue, need suggestion to optimize query
I wanted to get TOP 5 records from log table where “Approve date” is changed like NULL to value and vice versa. Date value is doesn’t matter, but order matters. In this case I want first record and 5th record (Someone approved the data that’s why a value),then 7th record value is null someon…
How do I use FCM with codeigniter sql webpage?
I am trying to implement a notification features on my android apps using firebase FCM on a sql db. My question is, I have a web page for admin to input the data. Is it possible to have whenever the …