I gang


# I have the following table:

CREATE TABLE RES (S int, R int, Q int, P int, RES varchar(100), M int );

# With the following contents:












(1,1,2,11,"Isaac Newton",NULL);

# I want a short UPDATE SET query to populate the NULL values

# after establishing rules indicated by the M field.

# For example, where S=1 and Q=1 and R=1 then we can establish that

# Where RES=London, M=1 and where RES=Paris, M=0

# I understand it needs to be an UPDATE SET statement with a subquery.

# NULLs should be retained where a rule cannot be established.

# The table is built in such a way that there will never be a conflict

# e.g. for RES=London, M will always equal 0 or NULL where S=1 and Q=1 and R=1

# The query should not reference specific values for any field

# The query needs to update all the NULLs where it can,

# and leave the NULLs as they are where it can't.

# the P field is not relevant, but is included to show there is no primary key.

# Secondly, I have the following table

CREATE TABLE QUA (S int, R int, Q int, ANS varchar(100));

# With the following contents:



(1,1,2,"Isaac Newton");

# This establishes rules for populating the RES table with 1s in the M column.

# Where RES.M is NULL, a second UPDATE SET query should update the RES table.

# It should leave other NULLs as they are.

# Please provide two query lines that can be run successfully on [url removed, login to view]

# Many thanks.

Færdigheder: MySQL, Oracle, SQL

Se mere: update query mysql, oracle com, sql r, sql in r, r sql, p sql, query table, qua, oracle sql p, isaac, berlin, mysql populate table, mysql update field, mysql update values, update insert sql, update values mysql, insert mysql table, 2013 query, update field sql field field, mysql create table, mysql insert update , oracle update statement, mysql update table, sql query field, mysql statement

Om arbejdsgiveren:
( 6 bedømmelser ) Tunbridge Wells, United Kingdom

Projekt-ID: #4098734

Tildelt til:


Hey solved and tested on sqlfiddle. Please see PM.

$30 USD på 1 dag
(4 bedømmelser)

3 freelancers are bidding on average $30 for this job


Hi I have over 10 years of experience working with MySQL and will create the required update statements in a quick time. Thanks Gopisoft Private Limited

$30 USD på 1 dag
(53 bedømmelser)

Please Check PMB.

$30 USD på 1 dag
(23 bedømmelser)

Hello, i can solve your request in 2hours. Thanks

$30 USD på 1 dag
(12 bedømmelser)