pdate (or row by row?)
>
> - Original Message - From: "nixofortune" <
> nixofort...@googlemail.com>
>
> To:
> Sent: Wednesday, September 22, 2010 5:29 PM
>
> Subject: Swap data in columns
>
>
> Hi all.
>>
>> Sorry for very simple question
tune [mailto:nixofort...@googlemail.com]
Sent: 22 September 2010 6:30 PM
To: mysql@lists.mysql.com
Subject: Swap data in columns
Hi all.
Sorry for very simple question, just can't figure out the solution.
I need to swap data in column1 with data in column2.
++-+-+
| id | column1
ow by row?)
- Original Message -
From: "nixofortune"
To:
Sent: Wednesday, September 22, 2010 5:29 PM
Subject: Swap data in columns
Hi all.
Sorry for very simple question, just can't figure out the solution.
I need to swap data in column1
sage-
From: Egor Shevtsov [mailto:nixofort...@googlemail.com]
Sent: Wednesday, September 22, 2010 4:14 PM
To: MySQL mailing list
Subject: Re: Swap data in columns
Hi Rolando,
This is perfect solution I was looking for.
Why do you use left join here? It looks like inner join works fine as well.
Th
Rows matched: 5 Changed: 5 Warnings: 0
> > >
> > > lwdba@ (DB test) :: SELECT * FROM mydata;
> > > ++-+-+
> > > | id | column1 | column2 |
> > > ++-----+---------+
> > > | 1 | z | a |
> > >
!!!
Rolando A. Edwards
MySQL DBA (CMDBA)
155 Avenue of the Americas, Fifth Floor
New York, NY 10013
212-625-5307 (Work)
AIM & Skype : RolandoLogicWorx
redwa...@logicworks.net
http://www.linkedin.com/in/rolandoedwards
-Original Message-
From: nixofortune [mailto:nixofort...@googlem
> GIVE IT A TRY !!!
>
> Rolando A. Edwards
> MySQL DBA (CMDBA)
>
> 155 Avenue of the Americas, Fifth Floor
> New York, NY 10013
> 212-625-5307 (Work)
> AIM & Skype :
> rolandologicworxredwa...@logicworks.nethttp://www.linkedin.com/in/rolandoedwards
>
>
&
ECT * FROM mydata;
> > ++-+-+
> > | id | column1 | column2 |
> > ++-+-+
> > | 1 | z | a |
> > | 2 | y | b |
> > | 3 | x | c |
> > | 4 | w | d |
> > | 5 | v
z | a |
> | 2 | y | b |
> | 3 | x | c |
> | 4 | w | d |
> | 5 | v | e |
> ++-+-+
> 5 rows in set (0.00 sec)
>
> GIVE IT A TRY !!!
>
> Rolando A. Edwards
> MySQL DBA (CMDBA)
>
> 155 Avenue
redwa...@logicworks.net
http://www.linkedin.com/in/rolandoedwards
-Original Message-
From: nixofortune [mailto:nixofort...@googlemail.com]
Sent: Wednesday, September 22, 2010 12:30 PM
To: mysql@lists.mysql.com
Subject: Swap data in columns
Hi all.
Sorry for very simple question, just can'
Hi all.
Sorry for very simple question, just can't figure out the solution.
I need to swap data in column1 with data in column2.
++-+-+
| id | column1 | column2 |
++-+-+
| 1 | a | z |
| 2 | b | y |
| 3 | c | x |
| 4
11 matches
Mail list logo