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).
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}{|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

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_2

Step: 3

blur-text-image_3

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

From Zero To Data Hero With Chatgpt

Authors: Andrew Wu

1st Edition

B0CQRJPXD9, 979-8989523009

More Books

Students also viewed these Databases questions

Question

How do books become world of wonder?

Answered: 1 week ago