Ashutosh Dhundhara a écrit :
> Hi,
> I was working on RFE #861 (Simulate UPDATE query).
> Lets say I have two tables:
>
> `table_1`
> +----+----------+
> | id | value |
> +----+----------+
> | 10 | value_10 |
> | 20 | value_20 |
> +----+----------+
>
> `table_2`
> +----+----------+
> | id | value |
> +----+----------+
> | 10 | value_10 |
> | 20 | value_20 |
> +----+----------+
>
> UPDATE Query: UPDATE table_1, table_2 SET table_1.value = 'NEW_VALUE', table_2.value='NEW_VALUE' WHERE table_1.id >
10 AND table_2.id > 10;
>
> This will affect 2 rows.
>
> How to simulate this query using SELECT statement?
>
> I was trying:
>
> SELECT DISTINCT table_1.value, table_2.value FROM table_1, table_2 WHERE table_1.value <> 'NEW_VALUE' AND table_2.value <> 'NEW_VAUE' AND table_1.id > 10 AND table_2.id > 10;
>
>
> but this only returns 1 row.
> Can this be done in a single query only?
>
> Regards,
> Ashutosh Dhundhara
Hi Ashutosh,
any reason why in your SELECT statement, you are using "<> 'NEW_VALUE'"
but in your UPDATE statement, you are using "='NEW_VALUE'" ?
--
Marc Delisle (phpMyAdmin)
------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems_______________________________________________
Phpmyadmin-devel mailing list
Phpmyadmin-devel@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel