Question: 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).
i Need a query written in Mysql. the table picture is attached.
the screenshot with zeros in the table is the one you will

\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}{|c|} \hline 1 \\ \hline 2 \\ \hline 3 \\ \hline 4 \\ \hline 5 \\ \hline 6 \\ \hline 7 \\ \hline 8 \\ \hline 9 \\ \hline 10 \\ \hline 11 \\ \hline 12 \\ \hline 13 \\ \hline 14 \\ \hline 15 \\ \hline 16 \\ \hline 17 \\ \hline 18 \\ \hline 19 \\ \hline 20 \\ \hline 21 \\ \hline 1 \\ \hline 1 \\ \hline 1 \\ \hline 1 \\ \hline 1 \\ \hline 1 \\ \hline 1 \\ \hline 1 \\ \hline 1 \\ \hline 1 \\ \hline 1 \\ \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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!