Answered step by step
Verified Expert Solution
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:
\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} 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).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started