Hi everyone first thanks for your time. I have this data Data: And I have to obtain the max values of everygroup, if there is one group that has two same max values like A 40 23/56/1982 A 40 31/4/…
How to SELECT from column WHERE we have multiple conditions in from another TABLE?
I have 3 TABLES: movies which has title and id columns stars which has person_id and movie_id columns people which has id and name columns I want to write a SQL query to list the titles of all …
SQL pivot query to get the result in a single row
I have a users table as I have another user_custom_fields table as and a third custom_fields table Here the problem is I need the result for each user in a single row with all the custom field_name as column header as I have heard about pivot queries but I don’t have much knowledge of SQL. Can anyone he…
Retrieve Specific Text from String where Search String Exists and Not Exists
I’ve got the following code. It returns the correct result for the first two test strings, where it should return the text between the two ****. The 3rd string returns ” abcd two two ****” …
How to select and update row, so that the same row could not be selected again by any user?
I am sending sms to mobile numbers using many apis at the same time, now I want to ensure that only one sms should be sent to one mobile number. I am selecting a row using the following query while selecting the row I want to set field i_sms_sent_count to 1 so that this row could not be selected again
How to group dates in Quarters in SQLite
I need to group my dates as Quarters, April to June as Q1, Jul to Sep as Q2, Oct to Dec as Q3 and Jan to March as Q4 I need to add another column besides close_dates showing Quarters. I cannot find …
Display a record although the condition return zero record
I have MySql query like this: SELECT name, id_number, hr.id, file, created_at, updated_at From users u LEFT JOIN homework_targets ht on u.class_id = ht.class_id LEFT JOIN homework_replies hr on u.id =…
Best way to create and host a python webapp that takes user input and adds it to sql databases?
I’m currently working on a project to make data entry easier for myself, I have sql tables set up in an azure database, and i can write python code that adds data to them easily enough, but what i …
compute time difference between rows and conditional group by using PostgreSQL
I have data like as shown below: +——-+——-+ | index | time | +——-+——-+ | 1 | 09.00 | | 2 | 09.02 | | 3 | 09.03 | | 4 | 09.05 | | 5 | 09.11 | | 6 | 09.12 | | …
SET parameters to microsoft SQL server to set environment
I have created some microsoft SQL server queries to insert values into some of my tables created. Below are the sql queries i used. Above is a piece of code which i have used for dev environment. Same code with prod instead of dev should be used for production. Is there any way to parameterize dev and prod to…