Help in sql

Completed Posted 1 month ago Paid on delivery
Completed Paid on delivery

Help needed in sql code via dataiku

My issue is two-fold.

Aussuming i have the following table

CONTRACT ID CONTRACT NUMBER DATE STATUS

A 4582 2024-09 ACTIVE

A 4582 2024-08 ACTIVE

A 4582 2024-07 CREATED

B 8952 2023-11 ACTIVE

B 8952 2023-10 CREATED

C 8952 2024-10 ACTIVE

C 8952 2024-09 ACTIVE

C 8952 2024-08 CREATED

D 4582 2023-09 TERMINATED

D 4582 2023-08 ACTIVE

D 4582 2023-07 CREATED

They main key is built on two fields : CONTRACT ID & CONTRACT NUMBER

What i need: I would like to get all lines that have an ACTIVE active as of 2024-09. And if the line for this date is not existing that having the last line with an ACTIVE status displayed as well.

In other terms, the result of the query should be the following

CONTRACT ID CONTRACT NUMBER DATE STATUS

A 4582 2024-09 ACTIVE

B 8952 2023-11 ACTIVE

C 8952 2024-09 ACTIVE

SQL C# Programming Microsoft SQL Server Database Administration MySQL

Project ID: #38885737

About the project

22 proposals Remote project Active 1 mo ago

Awarded to:

ranatech

I have read your requirements I have 10 years of experience in html css php MySQL I am ready to start Payment after full satisfaction

€10 EUR in 2 days
(56 Reviews)
6.2

22 freelancers are bidding on average €22 for this job

alihassan321

As an experienced database developer with a deep understanding of SQL and multiple databases like MSSQL and MySQL, I can offer precise assistance tailored to your specific needs. In the given project, I understand that More

€29 EUR in 7 days
(66 Reviews)
6.5
mobimubasir

Hello. I read your requirement i will do that. Please come on chat we will discuss more about this. I will waiting your reply

€29 EUR in 1 day
(34 Reviews)
5.4
junaidhussnain36

Solution to your project based on my expertise: - Write a query to retrieve rows with "ACTIVE" status for the specified date (2024-09). - If no row exists for 2024-09, retrieve the most recent "ACTIVE" status row. - En More

€30 EUR in 1 day
(1 Review)
4.4
toriquldev123

Hello Dear! Good Day! Hope you are doing fine. This is Toriqul Islam . I am an expert "Web Developer" with 10+ years of working experience in PHP, HTML5, CSS3, JavaScript, jQuery, Bootstrap, MySql and different Frame More

€29 EUR in 1 day
(12 Reviews)
4.2
saifansari2

Hello, how are you? I am ready to resolve this sql help i will do it right now.. Contract id with active status you need i will do it now........

€25 EUR in 1 day
(13 Reviews)
3.4
faisalazeem20

Hello, Thank you so much for providing detailed information about your job. It instantly grabbed my attention and aligns perfectly with my experience as database developer. I have completed numerous jobs related to dat More

€30 EUR in 7 days
(7 Reviews)
3.1
miroslavg1

✋!!STOP HERE!!✋ Dear client, Thanks for your job posting and hope you are doing well. I am writing to express my interest in the open Help in sql. With over seven years of specialized experience in SQL, C# Programming More

€25 EUR in 1 day
(1 Review)
1.4
BradenChain

With my skills in C# Programming and specialized proficiency in MySQL, I am more than prepared to help resolve your SQL issue through Dataiku. Your specific query requests some intricate manipulations and precise logic More

€25 EUR in 7 days
(1 Review)
1.4
shahzadak10

"Help in sql" sir i read your project brief and I will do your project . Please review my similar portfolio My Experience in this field for last 10 years and i m very consistent in my work i work almost 20 hours a More

€8 EUR in 1 day
(0 Reviews)
0.0
shehzadasalim

Hi Dhak E., I understand you need SQL code that fetches specific rows based on the ACTIVE status as of 2024-09, with a fallback to the last ACTIVE status if no entry exists for that date. I can efficiently assist with More

€19 EUR in 7 days
(0 Reviews)
0.0
kentman234

Hello I will help you. I am skilled and experienced SQL engineer. Let's talk now. Thank you Best Regards

€20 EUR in 7 days
(0 Reviews)
0.0
vishals397

Hi, My background in data science and engineering makes me an ideal fit for your SQL project. An expert in SQL, I've honed my skills through extensive experience in data handling and analysis. I specialize in designin More

€25 EUR in 5 days
(0 Reviews)
0.0
VladislavG1

hey, i can resolve your problem. let's connect. i am sql master, lol. ==========================================================================================

€19 EUR in 7 days
(0 Reviews)
0.0
AlexanderC1012

Pls check this. WITH ranked_status AS ( SELECT CONTRACT_ID, CONTRACT_NUMBER, DATE, STATUS, ROW_NUMBER() OVER (PARTITION BY CONTRACT_ID, CONTRACT_NUMBER ORDER BY DATE DESC) AS row_num FROM More

€10 EUR in 1 day
(0 Reviews)
0.0
MickeyKEG

Hi, there This project is very simple. If you hire me, I can solve this issue immediately. Best Regards. Mickey

€15 EUR in 7 days
(0 Reviews)
0.0
laibaq9

I understand you’re looking for help with an SQL query in Dataiku to fetch specific rows based on conditions related to active contracts. With my expertise in SQL and database management, I can make a precise query tha More

€16 EUR in 7 days
(0 Reviews)
0.0
adem500

Hi, I have extensive experience in SQL and Database management. I can help solve this issue quickly

€19 EUR in 2 days
(0 Reviews)
0.0