Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i Need a query written in Mysql. the table picture is attached. the screenshot with zeros in the table is the one you will working

i Need a query written in Mysql. the table
picture is attached. the screenshot with zeros in the table is the one you will working to turn into the table in the second screenshot. more instructions below:
Basically; I have these two columns "ID" and "Number", what i need to do is create a
query where I remove all the zeros and
replace them with the value in the "Number" column that corresponds to that zeros "ID". I want this done in a single query and i dont want you to use any numbers in the query other than zero (only if you need to use zero). please dont use a Min or Max function in the query either(if that's not possible please let me know)
image text in transcribed
image text in transcribed
\begin{tabular}{|r|r|} \hline \multicolumn{1}{|l|}{} & Number \\ \hline 676 & 44 \\ \hline 676 & 0 \\ \hline 843 & 57 \\ \hline 676 & 44 \\ \hline 843 & 0 \\ \hline 843 & 0 \\ \hline \end{tabular} \begin{tabular}{|r|r|} \hline ID & Number \\ \hline 676 & 44 \\ \hline 676 & 44 \\ \hline 843 & 57 \\ \hline 676 & 44 \\ \hline 843 & 57 \\ \hline 843 & 57 \\ \hline \end{tabular}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Navigating The Supply Chain Maze A Comprehensive Guide To Optimize Operations And Drive Success

Authors: Michael E Kirshteyn Ph D

1st Edition

B0CPQ2RBYC, 979-8870727585

More Books

Students also viewed these Databases questions