Re: help: innodb database cannot recover

2013-06-21 Thread Peter
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains information that should help you find out what is causing the crash. 130620 00:47:21 mysqld_safe Number of processes running now: 0 130620 00:47:21 mysqld_safe mysqld restarted InnoDB: Error: tablespace size stored in header is 456832 p

Re: help: innodb database cannot recover

2013-06-20 Thread Reindl Harald
Am 20.06.2013 23:47, schrieb Peter: >> Hello, >>> >>> I copied innodb database (ib_logfile0 ib_logfile1 ibdata1 and the whole >>> database directory) from one crashed machine to another. >>> I find that I cannot start database to get the database data any more. >> >> >>> How did you copy the d

Re: help: innodb database cannot recover

2013-06-20 Thread Peter
>Hello, >> >>I copied innodb database (ib_logfile0  ib_logfile1  ibdata1 and the whole >>database directory) from one crashed machine to another. >>I find that I cannot start database to get the database data any more. > > >>How did you copy the database? >>Manuel > >I copy the files ib_logfile

Re: help: innodb database cannot recover

2013-06-20 Thread Peter
2013/6/20 Peter > >2013/6/20 Peter > >Hello, >> >>I copied innodb database (ib_logfile0  ib_logfile1  ibdata1 and the whole >>database directory) from one crashed machine to another. >>I find that I cannot start database to get the database data any more. > > >>How did you copy the databa

Re: help: innodb database cannot recover

2013-06-20 Thread Peter
Am 20.06.2013 15:18, schrieb Peter: >> >>> I copied innodb database (ib_logfile0  ib_logfile1  ibdata1 and the whole >>> database directory) from one crashed machine to another. >>> I find that I cannot start database to get the database data any more. > >>> How did you copy the database? >>> M

Re: help: innodb database cannot recover

2013-06-20 Thread Peter
Am 20.06.2013 15:18, schrieb Peter: >> >>> I copied innodb database (ib_logfile0  ib_logfile1  ibdata1 and the whole >>> database directory) from one crashed machine to another. >>> I find that I cannot start database to get the database data any more. > >>> How did you copy the database? >>>

Re: help: innodb database cannot recover

2013-06-20 Thread Manuel Arostegui
2013/6/20 Peter > > 2013/6/20 Peter > > Hello, > > I copied innodb database (ib_logfile0 ib_logfile1 ibdata1 and the whole > database directory) from one crashed machine to another. > I find that I cannot start database to get the database data any more. > > > >How did you copy the database? >

Re: help: innodb database cannot recover

2013-06-20 Thread Peter
2013/6/20 Peter Hello, > >I copied innodb database (ib_logfile0  ib_logfile1  ibdata1 and the whole >database directory) from one crashed machine to another. >I find that I cannot start database to get the database data any more. >How did you copy the database? >Manuel I copy the files ib_lo

Re: help: innodb database cannot recover

2013-06-20 Thread Reindl Harald
Am 20.06.2013 15:18, schrieb Peter: > 2013/6/20 Peter > > Hello, >> >> I copied innodb database (ib_logfile0 ib_logfile1 ibdata1 and the whole >> database directory) from one crashed machine to another. >> I find that I cannot start database to get the database data any more. > >> How did y

Re: help: innodb database cannot recover

2013-06-20 Thread Manuel Arostegui
2013/6/20 Peter > Hello, > > I copied innodb database (ib_logfile0 ib_logfile1 ibdata1 and the whole > database directory) from one crashed machine to another. > I find that I cannot start database to get the database data any more. How did you copy the database? Manuel

Re: help: innodb database cannot recover

2013-06-20 Thread Reindl Harald
nnoDB. The tail of the system tablespace is > InnoDB: missing > > is there a way to start the database again? > Thanks for your help in advance restore your backups that is one reason why replication exists to have a slave which a) does not die with the master at a complete crash

help: innodb database cannot recover

2013-06-20 Thread Peter
Hello, I copied innodb database (ib_logfile0  ib_logfile1  ibdata1 and the whole database directory) from one crashed machine to another. I find that I cannot start database to get the database data any more. I tried innodb_force_recovery=1 or innodb_force_recovery=4, it doesn't help. He

RE: Design help

2013-04-21 Thread Ilya Kazakevich
Hello, >Many thanks for your response. Can yo u offer any advice with regards usage >of country_codes eg gb and regions, cities etc ? I've been reading up on >http://en.wikipedia.org/wiki/ISO_3166 etc. Should I be looking to use a >Surrogate key for countries ? Or the country code like fr for

Re: Design help

2013-04-21 Thread Neil Tompkins
Many thanks for your response. Can yo u offer any advice with regards usage of country_codes eg gb and regions, cities etc ? I've been reading up on http://en.wikipedia.org/wiki/ISO_3166 etc. Should I be looking to use a Surrogate key for countries ? Or the country code like fr for France ? Sa

Re: Design help

2013-04-21 Thread Denis Jedig
Neil, Am 21.04.2013 08:47, schrieb Neil Tompkins: Using joins I can obtain which country each city belongs too. However, should I consider putting a foreign key in the CITIES table referencing the countries_id ? Or is it sufficient to access using a join ? It depends. Adding a reference to

Design help

2013-04-20 Thread Neil Tompkins
Hi I'm creating the following basic tables COUNTRIES countries_id name REGIONS region_id countries_id name CITIES cities_id region_id Using joins I can obtain which country each city belongs too. However, should I consider putting a foreign key in the CITIES table referencing the countries_i

Query Help

2013-04-19 Thread Richard Reina
Hello All, Happy Friday! I know how to do the following query: >select count(*) from sales where WEEK(sale_date)=15 AND YEAR(sale_date)=2013; But can someone tell me I can do a query that will give me: the count(*) for each week of 2013 so that I end up with: WEEK | COUNT 1 | 22 2

Re: Query Help

2013-04-19 Thread Richard Reina
Perfect! Thank you Larry et all. Have a great weekend. 2013/4/19 Larry Martell > On Fri, Apr 19, 2013 at 8:24 AM, Richard Reina > wrote: > > Hello All, > > > > Happy Friday! I know how to do the following query: > > > >>select count(*) from sales where WEEK(sale_date)=15 AND > > YEAR(sale_dat

Re: Query Help

2013-04-19 Thread Larry Martell
On Fri, Apr 19, 2013 at 8:24 AM, Richard Reina wrote: > Hello All, > > Happy Friday! I know how to do the following query: > >>select count(*) from sales where WEEK(sale_date)=15 AND > YEAR(sale_date)=2013; > > But can someone tell me I can do a query that will give me: > > the count(*) for each w

RE: Query Help

2013-04-19 Thread Ilya Kazakevich
Hello Richard, >the count(*) for each week of 2013 so that I end up with: http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html Ilya. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql

Re: help with mysql db names

2013-04-19 Thread Carsten Pedersen
On 19.04.2013 06:49, Kapil Karekar wrote: Though I would recommend not using such names. Some poor guy working on your application six months down the line is going to wonder why his queries are failing, spend a day trying to figure out and will post the same question again to this list :-) .

help with mysql db names

2013-04-18 Thread Doug
Hello, why these db names created fail but the last one gets success? mysql> create database 3208e1c6aa32; 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 '3208e1c6aa32' at line 1 mysql> cre

Re: help with mysql db names

2013-04-18 Thread Keith Keller
On 2013-04-19, Doug wrote: > > why these db names created fail but the last one gets success? [snips] > mysql> create database 3208e1c6aa32; > mysql> create database 208e1c6aa32; > mysql> create database 08e1c6aa32; > mysql> create database 8e1c6aa32; > mysql> create database e1c6aa32; https://

Re: help with mysql db names

2013-04-18 Thread Kapil Karekar
On 19-Apr-2013, at 9:14 AM, Doug wrote: > why these db names created fail but the last one gets success? > > mysql> create database 3208e1c6aa32; > mysql> create database 208e1c6aa32; > mysql> create database 08e1c6aa32; > mysql> create database 8e1c6aa32; These are not working because MySQL is

Re: Please Help. selectcol_arrayref problem

2013-04-02 Thread Stillman, Benjamin
Nope. That's just granting replication privileges so it can read updates on all tables on all databases. It cannot select anything. Why are you trying to connect with a replication slave user? On 4/2/13 1:47 PM, "Richard Reina" wrote: >I did a "GRANT REPLICATION SLAVE ON *.* TO 'user'@'19

Re: Please Help. selectcol_arrayref problem

2013-04-02 Thread Larry Martell
On Tue, Apr 2, 2013 at 11:30 AM, Richard Reina wrote: > use DBI; > my $dbh = DBI->connect( "DBI:mysql:rushload;192.168.0.1", $usrr, $passw, { > RaiseError => 3 } ); > my $dbs = $dbh->selectcol_arrayref("show databases"); > > #my $dsn = "dbi:mysql:information_schema:192.168.0.1:3306"; > #my $dbh =

Re: Please Help. selectcol_arrayref problem

2013-04-02 Thread Richard Reina
I did a "GRANT REPLICATION SLAVE ON *.* TO 'user'@'192.168.0.23' IDENTIFIED BY 'psswd'; on the master. Doesn't *.* mean everything? Why would it just show me to databases? 2013/4/2 Larry Martell > On Tue, Apr 2, 2013 at 11:30 AM, Richard Reina > wrote: > > use DBI; > > my $dbh = DBI->conn

Please Help. selectcol_arrayref problem

2013-04-02 Thread Richard Reina
use DBI; my $dbh = DBI->connect( "DBI:mysql:rushload;192.168.0.1", $usrr, $passw, { RaiseError => 3 } ); my $dbs = $dbh->selectcol_arrayref("show databases"); #my $dsn = "dbi:mysql:information_schema:192.168.0.1:3306"; #my $dbh = DBI->connect($dsn, $usrr, $passw); my $dbs = $dbh->selectcol_arrayr

Re: Query help - Solved

2013-03-31 Thread william drescher
of course, "Group By" bill -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql

Re: Query help -

2013-03-31 Thread william drescher
On 3/31/2013 7:32 AM, william drescher wrote: I have a table, schedule: CREATE TABLE `schedule` ( `schedule_id` mediumint(9) NOT NULL AUTO_INCREMENT, `provider` varchar(15) NOT NULL, `apptTime` datetime NOT NULL, `location` varchar(10) NOT NULL, `duration` smallint(5) unsigned NOT

Query help -

2013-03-31 Thread william drescher
I have a table, schedule: CREATE TABLE `schedule` ( `schedule_id` mediumint(9) NOT NULL AUTO_INCREMENT, `provider` varchar(15) NOT NULL, `apptTime` datetime NOT NULL, `location` varchar(10) NOT NULL, `duration` smallint(5) unsigned NOT NULL, `standing_script` mediumint(9) DEFAULT NULL,

Re: Complex MySQL Select Statement Help

2013-02-03 Thread hsv
2013/02/02 12:58 -0600, Peter Brawley On 2013-02-01 10:18 PM, h...@tbbs.net wrote: >2013/01/31 22:24 -0600, Peter Brawley >Is this what you mean? > >Select, >pricelist >If( !IsNull(specialprice) And specialprice < unitprice And CurDate() Between >startingDate And endingDate, >sp

Re: Complex MySQL Select Statement Help

2013-02-02 Thread Peter Brawley
On 2013-02-01 10:18 PM, h...@tbbs.net wrote: 2013/01/31 22:24 -0600, Peter Brawley Is this what you mean? Select, pricelist If( !IsNull(specialprice) And specialprice < unitprice And CurDate() Between startingDate And endingDate, specialprice, unitprice ) as used_price >From catalog Where

Re: Complex MySQL Select Statement Help

2013-02-02 Thread hsv
2013/01/31 22:24 -0600, Peter Brawley Is this what you mean? Select, pricelist If( !IsNull(specialprice) And specialprice < unitprice And CurDate() Between startingDate And endingDate, specialprice, unitprice ) as used_price >From catalog Where itemid='WB314'; PB Maybe this i

Re: Complex MySQL Select Statement Help

2013-01-31 Thread Peter Brawley
ber_format(mysql_result($result,0,"priceList"),2)); printf('Your Price: $%s', number_format(mysql_result($result,0,"used_price"),2)); ?> This seems rather convoluted to me and I've been struggling with it all day. Any help would be greatly

Complex MySQL Select Statement Help

2013-01-31 Thread Angela Barone
x27;, number_format(mysql_result($result,0,"priceList"),2)); printf('Your Price: $%s', number_format(mysql_result($result,0,"used_price"),2)); ?> This seems rather convoluted to me and I've been struggling with it all day. Any help would b

Re: Help restoring database: MacOS Server (Snow Leopard)

2013-01-10 Thread Jan Steinman
Okay, panic over. I recursively stripped the ACLs and things are working. Next time I drop a table from phpMyAdmin, I'll carefully read the little thing that pops up saying I'm about to drop an entire database... :-( One gets so "yea, whatever" to warning notifiers...) Thanks to all who sent he

Re: Help restoring database: MacOS Server (Snow Leopard)

2013-01-09 Thread Karen Abgarian
Hi, It is not very surprising that the database cannot recover from a Time Machine backup. This generally applies to any software that is running at the moment the backup is taken. The InnoDB is especially sensitive to taking what is called a 'dirty' backup because it has a cache. You ma

Re: Help restoring database: MacOS Server (Snow Leopard)

2013-01-09 Thread Reindl Harald
Am 09.01.2013 16:33, schrieb Jan Steinman: > I accidentally dropped a crucial database. My only backup is via Apple's Time > Machine. > > First, I stopped mysqld and copied (via tar) the database in question from > the backup. Restarted, but drat -- most of the tables were apparently using >

Help restoring database: MacOS Server (Snow Leopard)

2013-01-09 Thread Jan Steinman
I accidentally dropped a crucial database. My only backup is via Apple's Time Machine. First, I stopped mysqld and copied (via tar) the database in question from the backup. Restarted, but drat -- most of the tables were apparently using innodb's ibdata1 file, as only the MyISAM tables showed u

Re: Basic SELECT help

2012-12-18 Thread Shawn Green
presented in the subset. If I looked for 2 terms and I ended up with hits=2, then I know that those ID values matched on both terms. You can expand on this pattern to also do partial (M of N search terms) or best-fit determinations. I hope this was the kind of help you were looking for. Reg

Re: Help with left outer join

2012-12-12 Thread Larry Martell
ta_cstimage.name column. I think I need a left > outer join, but I've been messing with this for hours, and I can't get > the syntax right. I've googled it, but all the examples are simple > with just 2 tables. Can someone help me with this? > <<<<<<<&

Re: Help with left outer join

2012-12-12 Thread Larry Martell
d is NULL I don't get that data_cst row. But I changed the RIGHT JOIN to a LEFT JOIN and then it was doing exactly what I wanted. Thanks for all the help! > On 2012-12-11 5:11 PM, Larry Martell wrote: > > SELECT data_target.name, ep, wafer_id, lot_id, >> >>date_time,

Re: Help with left outer join

2012-12-12 Thread Larry Martell
On Wed, Dec 12, 2012 at 8:25 AM, Shawn Green wrote: > On 12/11/2012 7:22 PM, h...@tbbs.net wrote: >> >> ... (Are all the distinct "id"s really needed? When one joins on a >> >> field with the same name in both tables, one may use 'USING', and >> only the common field, with neither NULL, shows up i

Re: Help with left outer join

2012-12-12 Thread Shawn Green
On 12/11/2012 7:22 PM, h...@tbbs.net wrote: ... (Are all the distinct "id"s really needed? When one joins on a field with the same name in both tables, one may use 'USING', and only the common field, with neither NULL, shows up in the output.) This is a perfectly acceptable naming convention t

Re: Help with left outer join

2012-12-11 Thread Peter Brawley
>ERROR 1054 (42S22): Unknown column 'data_tool.category_id' in 'on clause' >But category_id is a column in data_tool. Then a bit of reordering is required ... SELECT data_target.name, ep, wafer_id, lot_id, date_time, data_file_id, data_cstimage.name, bottom, wf_file_path_id, data_m

Re: Help with left outer join

2012-12-11 Thread hsv
've googled it, but all the examples are simple with just 2 tables. Can someone help me with this? <<<<<<<< Modern forms do not give a left join if one uses WHERE-clause to reduce a full cross-join to an inner join. It is better to start with something like this, FROM dat

Re: Help with left outer join

2012-12-11 Thread Larry Martell
on clause' But category_id is a column in data_tool. > I think I need a left > outer join, but I've been messing with this for hours, and I can't get > the syntax right. I've googled it, but all the examples are simple > with just 2 tables. Can someone help me with this? > > TIA! > -larry > > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql

Re: Help with left outer join

2012-12-11 Thread Peter Brawley
tax right. I've googled it, but all the examples are simple with just 2 tables. Can someone help me with this? TIA! -larry

query running very slow, need a little help

2012-12-04 Thread Paul Nowosielski
Hi, I'm running this query: mysql> SELECT email FROM promoters where id NOT IN (SELECT promoter_id FROM credits WHERE success = 1 ) and active = 1; Empty set (31.89 sec) its returning an empty set and take over 30 seconds to return. mysql> describe promoters; +---+--

Re: query running very slow, need a little help

2012-12-04 Thread Akshay Suryavanshi
Hi, A subquery with IN clause is not a good idea. If you want to tune this query, try adding indexes on the tables accessed in the inner query "credits". A composite index on (success,promoter_id) would be sufficient, then the optimizer will use this index for the where clause and as a covering in

Re: Basic SELECT help

2012-11-23 Thread divesh kamra
:00 PM, Mogens Melander > > wrote: > >> > >> On Thu, November 22, 2012 15:45, Neil Tompkins wrote: > >>> Basically I only what to return the IDs that have both types. > >>> > >> > >> And that's exactly what below statement will return. &

Re: Basic SELECT help

2012-11-22 Thread Neil Tompkins
Claudio This is the solution i decided to go for as provided in a previous response. Thanks Neil On 23 Nov 2012, at 00:41, Claudio Nanni wrote: > On 11/22/2012 04:10 PM, Ben Mildren wrote: >> SELECT id FROM mytable WHERE type IN(x,y,z) GROUP BY id; > Ben you were almost there ;) > > SELECT id

Re: Basic SELECT help

2012-11-22 Thread Mogens Melander
t;> which version of MySQL you are running and >> what class you are attending. >> >> All necessary information to provide a sufficient help. >> >>> >>> On Thu, Nov 22, 2012 at 2:39 PM, marek gutowski >>> wrote: >>> >>>> SELECT D

Re: Basic SELECT help

2012-11-22 Thread Claudio Nanni
On 11/22/2012 04:10 PM, Ben Mildren wrote: SELECT id FROM mytable WHERE type IN(x,y,z) GROUP BY id; Ben you were almost there ;) SELECT id FROM mytable WHERE type IN(x,y,z) GROUP BY id HAVING COUNT(id)= The only bad is the hardcoded parameter in the HAVING, may be it might be improved. Anywa

Re: Basic SELECT help

2012-11-22 Thread hsv
2012/11/22 14:30 +, Neil Tompkins I'm struggling with what I think is a basic select but can't think how to do it : My data is id,type 1000,5 1001,5 1002,2 1001,2 1003,2 1005,2 1006,1 >From this I what to get a distinct list of id where the type equals 2 and 5 Any ideas ?

Re: Basic SELECT help

2012-11-22 Thread hsv
2012/11/22 14:30 +, Neil Tompkins I'm struggling with what I think is a basic select but can't think how to do it : My data is id,type 1000,5 1001,5 1002,2 1001,2 1003,2 1005,2 1006,1 >From this I what to get a distinct list of id where the type equals 2 and 5 Any ideas ?

Re: Basic SELECT help

2012-11-22 Thread Michael Dykman
u are attending. > > All necessary information to provide a sufficient help. > >> >> On Thu, Nov 22, 2012 at 2:39 PM, marek gutowski >> wrote: >> >>> SELECT DISTINCT id FROM table WHERE type IN ('2','5') >>> >>> should wor

Re: Basic SELECT help

2012-11-22 Thread Mogens Melander
e attending. All necessary information to provide a sufficient help. > > On Thu, Nov 22, 2012 at 2:39 PM, marek gutowski > wrote: > >> SELECT DISTINCT id FROM table WHERE type IN ('2','5') >> >> should work >> >> >> On 22 November 20

Re: Basic SELECT help

2012-11-22 Thread Mogens Melander
Hmmm. OR, IN and HAVING pops up. On Thu, November 22, 2012 15:30, Neil Tompkins wrote: > Hi, > > I'm struggling with what I think is a basic select but can't think how to > do it : My data is > > id,type > > 1000,5 > 1001,5 > 1002,2 > 1001,2 > 1003,2 > 1005,2 > 1006,1 > > From this I what to get

Re: Basic SELECT help

2012-11-22 Thread Michael Dykman
On Thu, Nov 22, 2012 at 11:58 AM, Neil Tompkins wrote: > > By unique you mean that no id and type would be duplicated like > > 1,1 > 1,1 > > Yes it isn't possible for duplicate id and type in more than 1 row Yes, that's exactly what I meant. - mdyk...@gmail.com May the Source be with you. --

Re: Basic SELECT help

2012-11-22 Thread Neil Tompkins
Doing a EXPLAIN on the SELECT statement it is using "Using where; Using temporary; Using filesort" with 14000 rows of data. How best to improve this; when I already have indexed on id and type On Thu, Nov 22, 2012 at 4:46 PM, Michael Dykman wrote: > Assuming that (id,type) is unique in the so

Re: Basic SELECT help

2012-11-22 Thread Neil Tompkins
Ignore that it does work fine. Sorry On Thu, Nov 22, 2012 at 4:46 PM, Michael Dykman wrote: > Assuming that (id,type) is unique in the source data, that is a pretty > elegant method: > > > select id from > > (select distinct id, count(*) > > from my_table > > where type in (2,5) > > group by id

Re: Basic SELECT help

2012-11-22 Thread Neil Tompkins
When trying this query I get FUNCTION id does not exist On Thu, Nov 22, 2012 at 4:46 PM, Michael Dykman wrote: > select id from > > (select distinct id, count(*) > > from my_table > > where type in (2,5) > > group by id > > having count(*) = 2)a; >

Re: Basic SELECT help

2012-11-22 Thread Neil Tompkins
By unique you mean that no id and type would be duplicated like 1,1 1,1 Yes it isn't possible for duplicate id and type in more than 1 row On Thu, Nov 22, 2012 at 4:46 PM, Michael Dykman wrote: > Assuming that (id,type) is unique in the source data, that is a pretty > elegant method: > > > se

Re: Basic SELECT help

2012-11-22 Thread Michael Dykman
Assuming that (id,type) is unique in the source data, that is a pretty elegant method: > select id from > (select distinct id, count(*) > from my_table > where type in (2,5) > group by id > having count(*) = 2)a; > -- - michael dykman - mdyk...@gmail.com May the Source be with you. -- MySQ

RE: Basic SELECT help

2012-11-22 Thread Jason Trebilcock
m: Neil Tompkins [mailto:neil.tompk...@googlemail.com] > Sent: Thursday, November 22, 2012 8:30 AM > To: [MySQL] > Subject: Basic SELECT help > > Hi, > > I'm struggling with what I think is a basic select but can't think how > to do it : My data is > >

Re: Basic SELECT help

2012-11-22 Thread Ben Mildren
*HAVING typelist = 'x,y,z'; On 22 November 2012 15:25, Ben Mildren wrote: > Ah read it quickly and misread your requirement. Joins are likely FTW > here. The alternative would be to do something like this, but I'd opt > for the joins if you have a reasonably sized data set: > > SELECT id, GROUP

Re: Basic SELECT help

2012-11-22 Thread Michael Dykman
Of course there is a cost for the join, each link being a distinct lookup query but that is the same cost the INTERSECT would impose. It is not a bad as multiple joins generally might be as all the lookups are against the same key in the same table which should keep that index in ram. (type is ind

Re: Basic SELECT help

2012-11-22 Thread Ben Mildren
Ah read it quickly and misread your requirement. Joins are likely FTW here. The alternative would be to do something like this, but I'd opt for the joins if you have a reasonably sized data set: SELECT id, GROUP_CONCAT(type ORDER BY type) AS typelist FROM mytable WHERE id IN(x,y,z) GROUP BY id H

Re: Basic SELECT help

2012-11-22 Thread Neil Tompkins
Do you know if I had multiple joins there would be a performance issue ? On Thu, Nov 22, 2012 at 3:06 PM, Michael Dykman wrote: > Keep joining I think. In the absence of intersect (which incurs the cost > of a query per type anyhow ), this join pattern is the only option I can > think of. > > O

Re: Basic SELECT help

2012-11-22 Thread Ben Mildren
SELECT id FROM mytable WHERE type IN(x,y,z) GROUP BY id; On 22 November 2012 15:01, Neil Tompkins wrote: > Michael, > > Thanks this kind of works if I'm checking two types. But what about if I > have 5 types ? > > On Thu, Nov 22, 2012 at 2:53 PM, Michael Dykman wrote: > >> response did not go t

Re: Basic SELECT help

2012-11-22 Thread Michael Dykman
Keep joining I think. In the absence of intersect (which incurs the cost of a query per type anyhow ), this join pattern is the only option I can think of. On 2012-11-22 10:01 AM, "Neil Tompkins" wrote: Michael, Thanks this kind of works if I'm checking two types. But what about if I have 5 ty

Re: Basic SELECT help

2012-11-22 Thread Neil Tompkins
Michael, Thanks this kind of works if I'm checking two types. But what about if I have 5 types ? On Thu, Nov 22, 2012 at 2:53 PM, Michael Dykman wrote: > response did not go to the list.. > > > I assume that you mean the id must be associated with both type=5 AND > type=2 as opposed to type=5

Re: Basic SELECT help

2012-11-22 Thread Neil Tompkins
How about if I have the following SELECT DISTINCT id FROM my_table WHERE (type = 3 OR type = 28 OR type = 1) In this instance, for the id 280149 it only has types 3 and 28 but *not *1. But using the OR statement returns id 280149 On Thu, Nov 22, 2012 at 2:53 PM, Benaya Paul wrote: > U ca

Re: Basic SELECT help

2012-11-22 Thread Benaya Paul
U can remove the type field it will work On Nov 22, 2012 8:21 PM, "Neil Tompkins" wrote: > Basically I only what to return the IDs that have both types. > > > On Thu, Nov 22, 2012 at 2:39 PM, marek gutowski >wrote: > > > SELECT DISTINCT id FROM table WHERE type IN ('2','5') > > > > should work >

Fwd: Basic SELECT help

2012-11-22 Thread Michael Dykman
response did not go to the list.. I assume that you mean the id must be associated with both type=5 AND type=2 as opposed to type=5 OR type=2; in some dialect of SQL (not mysql) you can do this: select distinct id from 'table' where type=5 intersect select distinct id from 'table' where type=2

Re: Basic SELECT help

2012-11-22 Thread Neil Tompkins
Basically I only what to return the IDs that have both types. On Thu, Nov 22, 2012 at 2:39 PM, marek gutowski wrote: > SELECT DISTINCT id FROM table WHERE type IN ('2','5') > > should work > > > On 22 November 2012 14:30, Neil Tompkins wrote: > >> Hi, >> >> I'm struggling with what I think is a

Re: Basic SELECT help

2012-11-22 Thread Mike OK
Hi Neil Would something like this work. SELECT DISTINCT id,type from your_table WHERE type=2 OR type=5; Mike - Original Message - From: "Neil Tompkins" To: "[MySQL]" Sent: Thursday, November 22, 2012 9:30 AM Subject: Basic SELECT help Hi, I'm struggli

Re: Basic SELECT help

2012-11-22 Thread marek gutowski
SELECT DISTINCT id FROM table WHERE type IN ('2','5') should work On 22 November 2012 14:30, Neil Tompkins wrote: > Hi, > > I'm struggling with what I think is a basic select but can't think how to > do it : My data is > > id,type > > 1000,5 > 1001,5 > 1002,2 > 1001,2 > 1003,2 > 1005,2 > 1006,1

Basic SELECT help

2012-11-22 Thread Neil Tompkins
Hi, I'm struggling with what I think is a basic select but can't think how to do it : My data is id,type 1000,5 1001,5 1002,2 1001,2 1003,2 1005,2 1006,1 >From this I what to get a distinct list of id where the type equals 2 and 5 Any ideas ? Neil

RE: Help with purging old logs for each customer ID

2012-10-25 Thread Daevid Vincent
, 2012 1:54 PM > To: Daevid Vincent; mysql@lists.mysql.com > Subject: RE: Help with purging old logs for each customer ID > > If the 90 days is back from MAX(created_on) for a given customer... >INDEX(customer_id, created_on) > will probably be needed. And that should repla

RE: Help with purging old logs for each customer ID

2012-10-25 Thread Rick James
.@daevid.com] > Sent: Thursday, October 25, 2012 1:33 PM > To: Rick James; mysql@lists.mysql.com > Subject: RE: Help with purging old logs for each customer ID > > Well, the customer_id is relevant in that I want the last 90 days > relative to each customer. > > customer_id

RE: Help with purging old logs for each customer ID

2012-10-25 Thread Daevid Vincent
there. Does that make more sense? I guess I was trying to avoid looping over every customer ID and computing if I could help it. I thought by using a GROUP BY or something it could group all the logs for a given customer and then trim them that way. But maybe brute force is the way to go? > -

RE: Help with purging old logs for each customer ID

2012-10-25 Thread Rick James
y, October 25, 2012 11:46 AM > To: mysql@lists.mysql.com > Subject: Help with purging old logs for each customer ID > > I have a customer log table that is starting to rapidly fill up (we > have hundreds of thousands of users, but many are transient, and use > the service for a f

Help with purging old logs for each customer ID

2012-10-25 Thread Daevid Vincent
log' in that I want to DELETE any entries older than 90 days for EACH `customer_id`. I'm not sure how to do that in a query? I'd rather not iterate over each customer_id if I can help it. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql

Re: Error message I am getting today. All help appreciated.

2012-10-19 Thread Andrés Tello
ne 15 > > Lost connection to MySQL server during query > > > > Able to log in to the phpmyadmin database account and the script that the > > query is pointing to has the right password and appears to the untrained > > eye to be working. > > > > I host with myh

Re: Error message I am getting today. All help appreciated.

2012-10-16 Thread Dehua Yang
e working. > > I host with myhosting.com and the site has been down for about 8 hours. > > Any and all help is appreciated. > > Yours Sincerely, > > Adrian Burridge > CanadianInvestors.com Inc. > >

Re: Error message I am getting today. All help appreciated.

2012-10-16 Thread Lixun Peng
in to the phpmyadmin database account and the script that the > query is pointing to has the right password and appears to the untrained > eye to be working. > > I host with myhosting.com and the site has been down for about 8 hours. > > Any and all help is appreciated. > >

Error message I am getting today. All help appreciated.

2012-10-16 Thread ad...@canadianinvestors.com
during query Able to log in to the phpmyadmin database account and the script that the query is pointing to has the right password and appears to the untrained eye to be working. I host with myhosting.com and the site has been down for about 8 hours. Any and all help is appreciated. Yours

Re: Need Help Converting Character Sets

2012-10-01 Thread hsv
2012/09/30 11:07 -0700, Mark Phillips The data for this table comes from a web page (charet utf8). I copy/paste word files into gedit (on linux) and then copy/paste from gedit to a text boxes on the web page input form. I had thought I was stripping out all the funky characters by usin

RE: Need Help Converting Character Sets

2012-10-01 Thread Rick James
the single straight one. But that would be work for you to explicitly do. If you are using PHP, see functions htmlentities() and html_entity_decode(). > -Original Message- > From: Mark Phillips [mailto:m...@phillipsmarketing.biz] > Sent: Sunday, September 30, 2012 11:08

RE: NOT_REGEXP Query Help

2012-10-01 Thread John Nichel
> -Original Message- > From: Rik Wasmus [mailto:r...@grib.nl] > Sent: Monday, October 01, 2012 10:44 AM > To: mysql@lists.mysql.com > Subject: Re: NOT_REGEXP Query Help > > > I'm having an issue using regular expressions, and I was hoping > > someon

Re: NOT_REGEXP Query Help

2012-10-01 Thread Rik Wasmus
> I'm having an issue using regular expressions, and I was hoping someone > can see the syntax error that I'm missing (Monday morning, not enough > coffee, etc). Running the following query returns the error: > > SELECT `a.custid`,`a.login` FROM ol.customers a WHERE `a.login` NOT_REGEXP > '^ano

NOT_REGEXP Query Help

2012-10-01 Thread John Nichel
er version 4.1.22 (yeah, I know it's old :) ) Any help would be greatly appreciated. -- John C. Nichel IV System Administrator KegWorks http://www.kegworks.com 716.362.9212 x160 j...@kegworks.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql

Re: Need Help Converting Character Sets

2012-09-30 Thread Mark Phillips
COLUMN BINARY (or BLOB); -- to forget any charset > knowledge > ALTER TABLE ... MODIFY COLUMN CHARACTER SET ...; -- coming from BINARY, > this does not check the encoding. > (sorry, don't have the link handy) > > > -Original Message----- > > From: h...@tb

RE: Need Help Converting Character Sets

2012-09-28 Thread Rick James
the encoding. (sorry, don't have the link handy) > -Original Message- > From: h...@tbbs.net [mailto:h...@tbbs.net] > Sent: Thursday, September 27, 2012 2:24 PM > To: Mark Phillips > Cc: Mysql List > Subject: Re: Need Help Converting Character Sets > > >>&

Re: Need Help Converting Character Sets

2012-09-27 Thread Derek Downey
To go along with what Rick is saying, this link might help you: http://dba.stackexchange.com/questions/10467/how-to-convert-control-characters-in-mysql-from-latin1-to-utf-8 I remember doing a bunch of converting HEX() control characters (such as an apostrophe copied from a Word document) before

Re: Need Help Converting Character Sets

2012-09-27 Thread hsv
2012/09/24 16:28 -0700, Mark Phillips I have a table, Articles, of news articles (in English) with three text columns for the intro, body, and caption. The data came from a web page, and the content was cut and pasted from other sources. I am finding that there are some non utf-8 characte

RE: Need Help Converting Character Sets

2012-09-24 Thread Rick James
eclared for the column they go in. (Presumably, all the text columns will be declared utf8 or utf8mb4.) > -Original Message- > From: Mark Phillips [mailto:m...@phillipsmarketing.biz] > Sent: Monday, September 24, 2012 4:28 PM > To: Mysql List > Subject: Need Help Convertin

<    1   2   3   4   5   6   7   8   9   10   >