Re: time stamp specific to columns

2015-04-14 Thread hsv
ping, MySQL already does much which the SQL programmer wants and cannot come at: "An auto-updated column is automatically updated to the current timestamp when the value of any other column in the row is changed from its current value. An auto-updated column remains unchanged if all other co

Re: Issue with timestamp columns while working with MySQL load data in file

2015-04-13 Thread hsv
On 2015/04/12 08:52, Pothanaboyina Trimurthy wrote: The problem is , as mentioned the load data is taking around 2 hours, I have 2 timestamp columns for one column I am passing the input through load data, and for the column "DB_MODIFIED_DATETIME" no input is provided, At the end o

Issue with timestamp columns while working with MySQL load data in file

2015-04-12 Thread Pothanaboyina Trimurthy
Hi All, I am facing an issue with timestamp columns while working with MySQL load data in file, I am loading around a million records which is taking around 2 hours to complete the load data. Before get into more details about the problem, first let me share the table structure. CREATE TABLE

Re: time stamp specific to columns

2015-04-09 Thread Michael Dykman
> On 4/8/15 6:36 AM, Martin Mueller wrote: >> >>> I understand how a timestamp column automatically changes when there is a >>> change in a data row. Is it possible to limit the update to changes in >>> particular columns? I have a table where I care about changes

Re: time stamp specific to columns

2015-04-09 Thread hsv
o split off the timestampy part to another table, and join them when needed. On 4/8/15 6:36 AM, Martin Mueller wrote: I understand how a timestamp column automatically changes when there is a change in a data row. Is it possible to limit the update to changes in particular columns? I have a ta

Re: time stamp specific to columns

2015-04-08 Thread Emil Oppeln-Bronikowski
W dniu 08.04.2015 o 17:42, Andrew Wallace pisze: I think you'd have to do that with a trigger. +1 for using triggers. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql

Re: time stamp specific to columns

2015-04-08 Thread Andrew Wallace
I think you'd have to do that with a trigger. On 4/8/15 6:36 AM, Martin Mueller wrote: I understand how a timestamp column automatically changes when there is a change in a data row. Is it possible to limit the update to changes in particular columns? I have a table where I care about ch

time stamp specific to columns

2015-04-08 Thread Martin Mueller
I understand how a timestamp column automatically changes when there is a change in a data row. Is it possible to limit the update to changes in particular columns? I have a table where I care about changes in any of four different columns, but I don¹t care about changes in other columns or added

Re: Query with variable number of columns?

2014-10-08 Thread hsv
>>>> 2014/10/08 11:38 -0700, Jan Steinman >>>> However, this pattern will often result in numerous empty columns -- empties that would not be there had the table not been pivoted. <<<<<<<< >>>> 2014/10/08 16:42 -0500, Peter Brawley >

Re: Query with variable number of columns?

2014-10-08 Thread Peter Brawley
sales.Date)='2008' THEN sales.Total ELSE NULL END) AS `2008`, SUM(CASE WHEN YEAR(sales.Date)='2009' THEN sales.Total ELSE NULL END) AS `2009`, ... WHERE dynamic predicate that only has results in one year However, this pattern will often result in numerous empty

Query with variable number of columns?

2014-10-08 Thread Jan Steinman
al ELSE NULL END) AS `2008`, SUM(CASE WHEN YEAR(sales.Date)='2009' THEN sales.Total ELSE NULL END) AS `2009`, ... WHERE dynamic predicate that only has results in one year However, this pattern will often result in numerous empty columns -- empties that would not be there had the

Re: SHOW FULL COLUMNS QUERIES hogging my CPU

2014-06-03 Thread Jatin Davey
ctor/J and found the getColumns() method building a stringBuffer object which evetually runs this "SHOW FULL COLUMNS" queries. I have to look at my code where ever this method is called and make sure we dont do it. But i have not nailed this down. It is still just an assumption that i h

Re: SHOW FULL COLUMNS QUERIES hogging my CPU

2014-06-03 Thread Jatin Davey
On 6/3/2014 4:47 PM, Johan De Meersman wrote: - Original Message - From: "Johan De Meersman" Subject: Re: SHOW FULL COLUMNS QUERIES hogging my CPU In any case, this is nothing that can be fixed on the database level. I may or may not have to swallow that :-p I've b

Re: SHOW FULL COLUMNS QUERIES hogging my CPU

2014-06-03 Thread Johan De Meersman
- Original Message - > From: "Johan De Meersman" > Subject: Re: SHOW FULL COLUMNS QUERIES hogging my CPU > > In any case, this is nothing that can be fixed on the database level. I may or may not have to swallow that :-p I've been hammering a munin plugin th

Re: SHOW FULL COLUMNS QUERIES hogging my CPU

2014-06-02 Thread Johan De Meersman
- Original Message - > From: "Jatin Davey" > Subject: Re: SHOW FULL COLUMNS QUERIES hogging my CPU > > Certain part of our code uses DataNucleas while other parts of the code A "data persistence product"... there's your problem. Persisting objec

Re: SHOW FULL COLUMNS QUERIES hogging my CPU

2014-06-02 Thread Morgan Tocker
Hi Jatin, On Jun 2, 2014, at 7:56 AM, Jatin Davey wrote: > I found this blog while trying to find a fix for my problem. Thought it might > be useful to share. > > Here it is: > > http://whirlpool.net.au/blog/5 To confirm - did you manage to fix your problem? I was about to comment that it l

Re: SHOW FULL COLUMNS QUERIES hogging my CPU

2014-06-02 Thread Jatin Davey
a total of 30 million queries made to the Database out of which 10 million queries were only doing "SHOW FULL COLUMN" queries. The SHOW FULL COLUMN queries were of the format as below: SHOW FULL COLUMNS FROM `APIC_PHY_FABRIC_

Re: SHOW FULL COLUMNS QUERIES hogging my CPU

2014-06-02 Thread Jatin Davey
every row but it still has to test against a significant subset of all rows: If you have 100 million rows, this will still cause your query to visit a very large number of them. So, I would have to ask: how many records are in that table? How many columns? is it a table or a view? On Mon, Jun 2,

Re: SHOW FULL COLUMNS QUERIES hogging my CPU

2014-06-02 Thread Jatin Davey
e of the format as below: SHOW FULL COLUMNS FROM `APIC_PHY_FABRIC_PHYSICAL_INTERFACE` FROM `db_private_admin` LIKE '%' This is causing considerable cpu usage in %user_time in my system fix your application - there is no single

Re: SHOW FULL COLUMNS QUERIES hogging my CPU

2014-06-02 Thread Singer Wang
ile was a whopping 4 GB is size. Upon analyzing the queries i >>> found that there were a total of 30 >>> million queries made to the Database out of which 10 million queries >>> were only doing "SHOW FULL COLUMN" queries. >>> >>> Th

Re: SHOW FULL COLUMNS QUERIES hogging my CPU

2014-06-02 Thread Michael Dykman
of them. So, I would have to ask: how many records are in that table? How many columns? is it a table or a view? On Mon, Jun 2, 2014 at 10:21 AM, Jatin Davey wrote: > On 6/2/2014 7:18 PM, Reindl Harald wrote: >> >> >> Am 02.06.2014 15:35, schrieb Jatin Davey: >

Re: SHOW FULL COLUMNS QUERIES hogging my CPU

2014-06-02 Thread Jatin Davey
The SHOW FULL COLUMN queries were of the format as below: SHOW FULL COLUMNS FROM `APIC_PHY_FABRIC_PHYSICAL_INTERFACE` FROM `db_private_admin` LIKE '%' This is causing considerable cpu usage in %user_time in my system fix your application - there is no single reason to run such quer

Re: SHOW FULL COLUMNS QUERIES hogging my CPU

2014-06-02 Thread Reindl Harald
queries. > > The SHOW FULL COLUMN queries were of the format as below: > > SHOW FULL COLUMNS FROM `APIC_PHY_FABRIC_PHYSICAL_INTERFACE` FROM > `db_private_admin` LIKE '%' > > This is causing considerable cpu usage in %user_time in my system fix your application -

SHOW FULL COLUMNS QUERIES hogging my CPU

2014-06-02 Thread Jatin Davey
file was a whopping 4 GB is size. Upon analyzing the queries i found that there were a total of 30 million queries made to the Database out of which 10 million queries were only doing "SHOW FULL COLUMN" queries. The SHOW FULL COLUMN queries were of the format as below: SHOW FULL CO

Troubles with creating indexes on float columns on MyISAM tables in MySQL 5.6.15 and MySQL 5.6.14 running on FreeBSD 8.4

2014-01-29 Thread Mikhail Berman
I got an "interesting" problem with creation of indexes on MyISAM tables in MySQL 5.6.15 and MySQL 5.6.14 running on FreeBSD 8.4 for float columns - I am not able to create indexes on these columns Indexes on all other columns work just fine The problem occur while I was loading data

Re: ALTER TABLE - correct way of adding columns?

2013-07-08 Thread Rafał Radecki
Have you used pt-online-schema-change.html from http://www.percona.com/doc/percona-toolkit/2.0/pt-online-schema-change.html ? What do you think about this tool? Best regards, Rafal Radecki. 2013/7/8 Rafał Radecki > Hi All. > > I would like to change the layout of my production database, I woul

Re: ALTER TABLE - correct way of adding columns?

2013-07-08 Thread Johan De Meersman
- Original Message - > From: "Rafał Radecki" > > I would like to change the layout of my production database, I would > like to add a column to an existing table. As I think before the ALTER > TABLE statement all access to the database should be denied/ended, then the > ALTER TABLE should

ALTER TABLE - correct way of adding columns?

2013-07-08 Thread Rafał Radecki
Hi All. I would like to change the layout of my production database, I would like to add a column to an existing table. As I think before the ALTER TABLE statement all access to the database should be denied/ended, then the ALTER TABLE should be performed, and then user/applications should be able

Re: Foreign key on multiple columns

2013-03-21 Thread Abhishek Choudhary
sage - From: Peter Brawley To: mysql@lists.mysql.com Cc: Sent: Thursday, 21 March 2013 8:14 PM Subject: Re: Foreign key on multiple columns On 2013-03-21 8:12 AM, Norah Jones wrote: > I'm trying to create a foreign key on two columns but getting error... > > Here's what I tri

Re: Foreign key on multiple columns

2013-03-21 Thread shawn green
On 3/21/2013 12:43 PM, Abhishek Choudhary wrote: CREATE TABLE test2 ( ID INT NOT NULL AUTO_INCREMENT, col1 INT NOT NULL, col2 INT NOT NULL, PRIMARY KEY (ID), CONSTRAINT fk FOREIGN KEY (col1, col2) REFERENCES test1(ID, ID

Re: Foreign key on multiple columns

2013-03-21 Thread Peter Brawley
On 2013-03-21 8:12 AM, Norah Jones wrote: I'm trying to create a foreign key on two columns but getting error... Here's what I tried: CREATE TABLE test2 ( ID INT NOT NULL AUTO_INCREMENT, col1 INT NOT NULL, col2 INT NOT NULL, PRIMARY KEY (ID),

Re: Getting distinct values in diff columns

2012-11-22 Thread Mogens Melander
Something like: select aname,max(adate) group by aname; On Thu, November 22, 2012 11:06, sagar bs wrote: > Hi all, > > > I have the table with two columns(account_name and order_date). In the > account_name col, some account names are only once and few account names > are tw

RE: Accessing Column Aliases In Other Columns?

2012-10-06 Thread Jan Steinman
Steinman [mailto:j...@bytesmiths.com] >> >> I would like to refer to calculated columns in other columns. I thought >> a column alias would do it, but apparently they're only for >> aggregation, like GROUP BY. >> >> Other than repeating the entire calculat

RE: Accessing Column Aliases In Other Columns?

2012-10-03 Thread Rick James
Wednesday, October 03, 2012 4:09 PM > To: mysql@lists.mysql.com > Subject: Accessing Column Aliases In Other Columns? > > I would like to refer to calculated columns in other columns. I thought > a column alias would do it, but apparently they're only for > aggregation, like GRO

Accessing Column Aliases In Other Columns?

2012-10-03 Thread Jan Steinman
I would like to refer to calculated columns in other columns. I thought a column alias would do it, but apparently they're only for aggregation, like GROUP BY. Other than repeating the entire calculation, what techniques are available for accessing such a calculation? I'm calc

RE: create alias for columns bound to database?

2012-05-21 Thread Rick James
Meersman [mailto:vegiv...@tuxera.be] > Sent: Monday, May 21, 2012 5:27 AM > To: Rick James > Cc: da...@lorenso.com; mysql@lists.mysql.com > Subject: Re: create alias for columns bound to database? > > - Original Message - > > From: "Rick James" > > >

Re: create alias for columns bound to database?

2012-05-21 Thread Johan De Meersman
- Original Message - > From: "Rick James" > > * should not begin with the table name Personally, I tend to prefix all column names with three-letter abbreviations of the table name, so that they are both unique across joins, and it's obvious what table they're from wherever they appear

RE: create alias for columns bound to database?

2012-05-18 Thread Rick James
; Sent: Friday, May 18, 2012 2:22 PM > To: mysql@lists.mysql.com > Subject: create alias for columns bound to database? > > All, > > I'd like to be able to create column aliases which are bound to the > database itself. I have an assortment of columns without naming &g

RE: create alias for columns bound to database?

2012-05-18 Thread David Lerer
@lists.mysql.com Subject: create alias for columns bound to database? All, I'd like to be able to create column aliases which are bound to the database itself. I have an assortment of columns without naming standards which i'd like to migrate to a better naming scheme. Is there a feature in

create alias for columns bound to database?

2012-05-18 Thread D. Dante Lorenso
All, I'd like to be able to create column aliases which are bound to the database itself. I have an assortment of columns without naming standards which i'd like to migrate to a better naming scheme. Is there a feature in MySQL that would allow me to give a database column mult

RE: One inst has 39 columns- the other 40

2012-03-22 Thread Brown, Charles
: One inst has 39 columns- the other 40 Am 22.03.2012 05:41, schrieb Brown: > Look man, there has to be someone out there that can tell me why one > user table has 5 extra columns. Is it version related or my sysprog > person missed out on a step. Its hard to believe that this problem

Re: One inst has 39 columns- the other 40

2012-03-22 Thread Mark Goodge
On 22/03/2012 04:41, Brown, Charles wrote: Look man, there has to be someone out there that can tell me why one user table has 5 extra columns. As far as I can see, plenty of people already have told you. Is it version related or my sysprog person missed out on a step. Yes, it's relat

Re: tables do not have the same number of columns.

2012-03-22 Thread Johan De Meersman
*plonk* - Original Message - > From: "Charles Brown" > To: "Reindl Harald" > Cc: "MySql" > Sent: Thursday, 22 March, 2012 5:37:00 AM > Subject: tables do not have the same number of columns. > > I have two mysql instances in my mysql

Re: One inst has 39 columns- the other 40

2012-03-22 Thread Reindl Harald
Am 22.03.2012 05:41, schrieb Brown: > Look man, there has to be someone out there that can tell me why one user > table > has 5 extra columns. Is it version related or my sysprog person missed out on > a > step. Its hard to believe that this problem is unique to my site.

Re: One inst has 39 columns- the other 40

2012-03-21 Thread Michael Dykman
. It looks like you have > different version' schemas. > > -NT > > > Em 22-03-2012 04:41, Brown, Charles escreveu: > >> Look man, there has to be someone out there that can tell me why one user >> table has 5 extra columns. Is it version related or my sysprog pers

Re: One inst has 39 columns- the other 40

2012-03-21 Thread Nuno Tavares
Charles, You should run "SELECT @@version" on both nodes. It looks like you have different version' schemas. -NT Em 22-03-2012 04:41, Brown, Charles escreveu: Look man, there has to be someone out there that can tell me why one user table has 5 extra columns. Is it versio

RE: One inst has 39 columns- the other 40

2012-03-21 Thread Brown, Charles
Look man, there has to be someone out there that can tell me why one user table has 5 extra columns. Is it version related or my sysprog person missed out on a step. Its hard to believe that this problem is unique to my site. Hostchar(60)NO PRI Userchar(16)NO

tables do not have the same number of columns.

2012-03-21 Thread Brown, Charles
I have two mysql instances in my mysql cluster. I noticed that their MysSQL.user tables do not have the same number of columns. See below for their attributes. Is anyone out there has any idea why these tables are not the same? Can someone help me. Hostchar(60)NO

Re: One inst has 39 columns- the other 40

2012-03-21 Thread Rik Wasmus
> You keep repeating that, and I already replied to it the first time. If my > answer isn't acceptable, spamming the question isn't going to make it > better - or make people more inclined to help you, for that matter. I concur -- Rik Wasmus -- MySQL General Mailing List For list archives: http

Re: One inst has 39 columns- the other 40

2012-03-21 Thread Reindl Harald
Am 21.03.2012 06:27, schrieb Brown: > I have two mysql instances in my mysql cluster. I noticed that their > MysSQL.user tables do not have the same number of columns. Their USER table > attributes are not the same. One instance has 39 columns while the other has > 42 columns.

Re: One inst has 39 columns- the other 40

2012-03-21 Thread Johan De Meersman
; > To: "Charles Brown" , mysql@lists.mysql.com > Sent: Wednesday, 21 March, 2012 6:27:17 AM > Subject: RE: One inst has 39 columns- the other 40 > > I have two mysql instances in my mysql cluster. I noticed that their > MysSQL.user tables do not have the same number of colu

RE: One inst has 39 columns- the other 40

2012-03-20 Thread Brown, Charles
I have two mysql instances in my mysql cluster. I noticed that their MysSQL.user tables do not have the same number of columns. Their USER table attributes are not the same. One instance has 39 columns while the other has 42 columns. Can someone please help me here. Could it be because I&#

One inst has 39 columns- the other 40

2012-03-19 Thread Brown, Charles
I have two mysql instances in my mysql cluster. I noticed that their MysSQL.user tables do not have the same number of columns. Their USER table attributes are not the same. One instance has 39 columns while the other has 42 columns. Can someone please help me here. Could it be because I&#

Re: One inst has 39 columns- the other 40

2012-03-19 Thread Johan De Meersman
- Original Message - > From: "Charles Brown" > > I have two mysql instances in my mysql cluster. I noticed that their > MysSQL.user tables do not have the same number of columns. Their > USER table attributes are not the same. One instance has 39 columns > wh

One inst has 39 columns- the other 40

2012-03-18 Thread Brown, Charles
I have two mysql instances in my mysql cluster. I noticed that their MysSQL.user tables do not have the same number of columns. Their USER table attributes are not the same. One instance has 39 columns while the other has 42 columns. Can someone please help me here. Could it be because I&#

Re: importing mysql structures only or restore ignoring non-existing tables and columns?

2011-10-31 Thread Luis Motta Campos
On 29 Oct 2011, at 22:59, luci spam wrote: > I have 2 servers (1 for development, 1 for service) > > I keep ADD/DELETE columns and CREATE/DELETE Indexes on my development > server, so these 2 server have similar but different mysql data structures. > > I know there

importing mysql structures only or restore ignoring non-existing tables and columns?

2011-10-29 Thread luci spam
I have 2 servers (1 for development, 1 for service) I keep ADD/DELETE columns and CREATE/DELETE Indexes on my development server, so these 2 server have similar but different mysql data structures. I know there's an option to expert structures only. (like –no-data) Is there a way (excep

How do I get more pages in mySQL Workbench?? WAS: Any table visualization tools with wires connecting the actual columns?

2011-05-03 Thread Daevid Vincent
I just discovered that MySQL Workbench actually WILL connect columns. Use the #6 wire type shortcut (bottom one). However, I must be retarded or blind because I can't figure out how to make the diagram have more than the default of 2 pages. I have a database with 50 tables and they just

Re: Any table visualization tools with wires connecting the actual columns?

2011-04-12 Thread Martijn Tonies
ools with wires connecting the actual columns? I am evaluating various tools for diagram generating of existing databases on some smaller databases (9 tables or so) first. The two I've tried so far are these: http://dev.mysql.com/downloads/workbench/ http://www.sqlmaestro.com/download/#mysql

Re: Any table visualization tools with wires connecting the actual columns?

2011-04-08 Thread Johan De Meersman
- Original Message - > From: "Daevid Vincent" > > It only seems to do the lines for InnoDB tables, not MyISAM... I > mean, it not only won't auto-connect them, it won't even allow ME to connect > them. :( Probably because it wants to adhere to the engine capabilities, and MyISAM doesn't

RE: Any table visualization tools with wires connecting the actual columns?

2011-04-08 Thread Daevid Vincent
8:50 PM > To: mysql@lists.mysql.com > Subject: RE: Any table visualization tools with wires connecting the actual > columns? > > At 05:36 PM 4/7/2011, Daevid Vincent wrote: > >I am a paid subscriber to SQLYog -- I love that tool, but AFAIK it > >doesn't do diagrams (with wire

RE: Any table visualization tools with wires connecting the actual columns?

2011-04-07 Thread mos
onnecting the actual > columns? > > At 02:17 PM 4/7/2011, Daevid Vincent wrote: > >Does anyone have any suggestions on this? I've written to SQL Maestro > >twice and they've not replied either. > > Take a look at SqlYog from www.webyog.com. I use their communi

RE: Any table visualization tools with wires connecting the actual columns?

2011-04-07 Thread Daevid Vincent
Sent: Thursday, April 07, 2011 12:38 PM > To: mysql@lists.mysql.com > Subject: Re: Any table visualization tools with wires connecting the actual > columns? > > Toad for MySQL can do the diagramming piece...but, it looks and feels like > you might have some of the same frustrations wit

RE: Any table visualization tools with wires connecting the actual columns?

2011-04-07 Thread Daevid Vincent
sday, April 07, 2011 1:36 PM > To: mysql@lists.mysql.com > Subject: Re: Any table visualization tools with wires connecting the actual > columns? > > At 02:17 PM 4/7/2011, Daevid Vincent wrote: > >Does anyone have any suggestions on this? I've written to SQL Maestro > >t

Re: Any table visualization tools with wires connecting the actual columns?

2011-04-07 Thread mos
ponsive to emails and forum posts. Mike From: Daevid Vincent [mailto:dae...@daevid.com] Sent: Friday, April 01, 2011 4:27 PM To: mysql@lists.mysql.com Subject: Any table visualization tools with wires connecting the actual columns? I am evaluating various tools for diagram generating o

Re: Any table visualization tools with wires connecting the actual columns?

2011-04-07 Thread Jason Trebilcock
written to SQL Maestro twice > and they've not replied either. > > > > From: Daevid Vincent [mailto:dae...@daevid.com] > Sent: Friday, April 01, 2011 4:27 PM > To: mysql@lists.mysql.com > Subject: Any table visualization tools with wires connecting the actual >

Any table visualization tools with wires connecting the actual columns?

2011-04-07 Thread Daevid Vincent
the actual columns? I am evaluating various tools for diagram generating of existing databases on some smaller databases (9 tables or so) first. The two I've tried so far are these: http://dev.mysql.com/downloads/workbench/ http://www.sqlmaestro.com/download/#mysql Both _seem_ robust a

Any table visualization tools with wires connecting the actual columns?

2011-04-01 Thread Daevid Vincent
to be concerned with what links to what -- that I tell it to. It's further exacerbated by the fact that the documentation indicates these aren't even REAL keys, they are cosmetic only! WTF? Why add confusion guys? 1. Neither one seem to be smart enough to automatically know that colu

Re: Foreign key with more columns and a constant value

2010-10-24 Thread Johan De Meersman
t; > I have more tables that have foreign keys which reference the table > constants and in this table the IDs of the constants are not unique alone, > but only in combination with the column "type". This is why I need to use a > foreign key with 2 columns. > > Is there a

Foreign key with more columns and a constant value

2010-10-23 Thread Octavian R��ni��
e foreign keys which reference the table constants and in this table the IDs of the constants are not unique alone, but only in combination with the column "type". This is why I need to use a foreign key with 2 columns. Is there a solution for what I want, or I will need to add that ex

Re: Swap data in columns

2010-09-23 Thread nixofortune
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

RE: Swap data in columns

2010-09-23 Thread Jangita
ALTER TABLE tablename1 CHANGE column1 column2 VARCHAR(64), CHANGE column2 column1 VARCHAR(64) Assuming the columns are varchar(64) Jangita | +254 76 918383 | MSN & Y!: jang...@yahoo.com Skype: jangita | GTalk: jangita.nyag...@gmail.com -Original Message- From: nixofor

Re: Swap data in columns

2010-09-22 Thread Kevin (Gmail)
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

RE: Swap data in columns

2010-09-22 Thread Rolando Edwards
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

Re: Swap data in columns

2010-09-22 Thread Johnny Withers
This is even better! JW On Wed, Sep 22, 2010 at 2:27 PM, Steve Staples wrote: > What about: > select `id`, `column1` as 'column2', `column2` as 'column1'; > > Steve > > > > On Wed, 2010-09-22 at 13:06 -0500, Johnny Withers wrote: > >

Re: Swap data in columns

2010-09-22 Thread Egor Shevtsov
!!! 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

Re: Swap data in columns

2010-09-22 Thread nixofortune
> 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 > > &

Re: Swap data in columns

2010-09-22 Thread Steve Staples
What about: select `id`, `column1` as 'column2', `column2` as 'column1'; Steve On Wed, 2010-09-22 at 13:06 -0500, Johnny Withers wrote: > Couldn't you just rename the columns? > > JW > > > On Wed, Sep 22, 2010 at 11:53 AM, Rolando Edwards > w

Re: Swap data in columns

2010-09-22 Thread Johnny Withers
Couldn't you just rename the columns? JW On Wed, Sep 22, 2010 at 11:53 AM, Rolando Edwards wrote: > I ran these commands: > > use test > DROP TABLE IF EXISTS mydata; > CREATE TABLE mydata (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,column1 > CHAR(1),column2 CHAR(2)

RE: Swap data in columns

2010-09-22 Thread Rolando Edwards
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'

Swap data in columns

2010-09-22 Thread nixofortune
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

Re: MySQL SUM on two columns

2010-08-31 Thread Tompkins Neil
Hi, I also wondered, if there is any way to LIMIT the products.rating for each language to say the top 25 ? Cheers Neil On Tue, Aug 31, 2010 at 12:11 PM, Tompkins Neil < neil.tompk...@googlemail.com> wrote: > Perfect. Exactly what I was looking for. > > Cheers John. > > Regards, > Neil > > On

Re: MySQL SUM on two columns

2010-08-31 Thread Tompkins Neil
Perfect. Exactly what I was looking for. Cheers John. Regards, Neil On Tue, Aug 31, 2010 at 12:06 PM, John Daisley wrote: > SELECT products_sales.language, SUM(products.rating) AS products_rating > > FROM products_sales > INNER JOIN products ON products_sales.products_id = products.products_id

Re: MySQL SUM on two columns

2010-08-31 Thread John Daisley
SELECT products_sales.language, SUM(products.rating) AS products_rating FROM products_sales INNER JOIN products ON products_sales.products_id = products.products_id WHERE products.enabled = 1 AND products_sales.language IN ('EN','ES') GROUP BY products_sales.language Will give the sum for each la

Re: MySQL SUM on two columns

2010-08-31 Thread Tompkins Neil
Sorry I don't want to SUM the varchar columns. This is the parameter passed that defines the two different queries. On Tue, Aug 31, 2010 at 11:48 AM, misiaQ wrote: > I don't think that SUM will work for varchar columns. > If I got your point right - you need to use WITH

RE: MySQL SUM on two columns

2010-08-31 Thread misiaQ
I don't think that SUM will work for varchar columns. If I got your point right - you need to use WITH ROLLUP grouping http://dev.mysql.com/doc/refman/5.0/en/group-by-modifiers.html see second example on that page. regards, m -Original Message- From: Tompkins Neil [mailto:neil.

MySQL SUM on two columns

2010-08-31 Thread Tompkins Neil
Hi, I've the following basic SUM for our products based on a rating. SELECT SUM(products.rating) AS products_rating FROM products_sales INNER JOIN products ON products_sales.products_id = products.products_id WHERE products.enabled = 1 AND products_sales.language = 'EN' This works fine, however

Re: Retrieve three columns in sub query

2010-08-25 Thread Tompkins Neil
l Message- > From: Tompkins Neil [mailto:neil.tompk...@googlemail.com] > Sent: Wednesday, August 25, 2010 1:23 PM > To: [MySQL] > Subject: Retrieve three columns in sub query > > Hi > > Is it possible in MySQL 5.1 to retrieve three columns in a select sub-query

Re: Retrieve three columns in sub query

2010-08-25 Thread Jo�o C�ndido de Souza Neto
ries intends to be an only one column and row > result. > > -- > João Cândido de Souza Neto > > "Tompkins Neil" escreveu na mensagem > news:aanlkti=djkujcsg=kf29sjsp0yllhmhb02mqzdvzd...@mail.gmail.com... > > Hi > > > > Is it possible in MySQL

RE: Retrieve three columns in sub query

2010-08-25 Thread misiaQ
select ci.*, ct.* from (select name, countrycode from city) ci, country ct where ci.countrycode = ct.code Regards, m -Original Message- From: Tompkins Neil [mailto:neil.tompk...@googlemail.com] Sent: Wednesday, August 25, 2010 1:23 PM To: [MySQL] Subject: Retrieve three columns in sub

Re: Retrieve three columns in sub query

2010-08-25 Thread Tompkins Neil
¢ndido de Souza Neto > > "Tompkins Neil" escreveu na mensagem > news:aanlkti=djkujcsg=kf29sjsp0yllhmhb02mqzdvzd...@mail.gmail.com... > > Hi > > > > Is it possible in MySQL 5.1 to retrieve three columns in a select > > sub-query > > like below : > >

Re: Retrieve three columns in sub query

2010-08-25 Thread Jo�o C�ndido de Souza Neto
As far as I know sub-queries intends to be an only one column and row result. -- João Cândido de Souza Neto "Tompkins Neil" escreveu na mensagem news:aanlkti=djkujcsg=kf29sjsp0yllhmhb02mqzdvzd...@mail.gmail.com... > Hi > > Is it possible in MySQL 5.1 to retrieve three

Retrieve three columns in sub query

2010-08-25 Thread Tompkins Neil
Hi Is it possible in MySQL 5.1 to retrieve three columns in a select sub-query like below : SELECT student_age, SELECT (student_subjects_id, random_mark, subject FROM student_subjects ORDER BY RAND(), LIMIT 1) FROM students WHERE student_age > 10 ORDER BY RAND() LIMIT 1 I've looked a

Re: Replication: ignore specified columns?

2010-07-23 Thread Claudio Nanni
No. If it is for security reasons: did you think about a view on slave db? (removing rights from source table) In case you dont want those columns to reach the slave you could use triggers to reflect changes from source table (or a view) on master to a table(with missing columns) that will be

Replication: ignore specified columns?

2010-07-23 Thread Bryan Cantwell
I know that you can ignore certain databases and tables in mysql replication, but is it possible to replicate all but a certain column or two from a table? This is 5.1.48 on linux. Thanks, Bryancan -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:

Re: Ordering field names in a "DESC / DESCRIBE table" or "SHOW COLUMNS from table" command

2010-01-14 Thread Ricardo Dias Marques
Vim text editor. I then did a column selection in that file (by pressing CTRL + V to enter "Visual Block" mode and then selecting and deleting), I removed the columns that I didn't need (basically, removed every column EXCEPT the "Field" column). I also removed the extra lines

Re: Ordering field names in a "DESC / DESCRIBE table" or "SHOW COLUMNS from table" command

2010-01-13 Thread Peter Brawley
ename ORDER BY Field". That failed: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY Field' at line 1 So, I went to read the online documentation about the DESCRIBE co

Ordering field names in a "DESC / DESCRIBE table" or "SHOW COLUMNS from table" command

2010-01-13 Thread Ricardo Dias Marques
to read the online documentation about the DESCRIBE command and the SHOW COLUMNS (or its synonym SHOW FIELDS) command: MySQL :: MySQL 5.0 Reference Manual :: 12.3.1 DESCRIBE Syntax http://dev.mysql.com/doc/refman/5.0/en/describe.html MySQL :: MySQL 5.0 Reference Manual :: 12.5.5.5 SHO

Join between columns with unique keys randomly uses the keys, or uses a temporary table (which fails).

2009-12-11 Thread Matthew Blissett
Hi all I have this query: SELECT n.ID, n.CatalogNumber, [...more...], d.ID, d.CatalogNumber, [...more...] FROM newdarwincoredata n INNER JOIN darwincoredata d ON n.CatalogNumber = d.CatalogNumber ORDER BY n.CatalogNumber; Both tables have exactly the same structure and indices: mysql> SHOW CREA

Re: Choose certain columns in mysqldump?

2009-11-03 Thread Brian Dunning
select into outfile was the ticket. Thanks! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

  1   2   3   4   5   6   7   8   9   >