Re: question about the mysql prepare/execute commands

2008-09-02 Thread Michael Dykman
; and then, at the end insert COMMIT See if that improves the numbers on the prepared statement. - michael dykman On Tue, Sep 2, 2008 at 5:41 PM, Jim Lyons [EMAIL PROTECTED] wrote: I have a question about the prepare/execute commands provided by mysql. I devised a benchmark, comparing updating a table using

Re: question about the mysql prepare/execute commands

2008-09-02 Thread Jim Lyons
:41 PM, Jim Lyons [EMAIL PROTECTED] wrote: I have a question about the prepare/execute commands provided by mysql. I devised a benchmark, comparing updating a table using a statement-at-a-time versus using a prepare/execute pair. The table had a million rows. The statement-at-a-time

question on mysql proxy's load balancing

2008-08-29 Thread Jenny Chen
Hi, When I read Jk's document on MySQL proxy: http://jan.kneschke.de/projects/mysql/mysql-proxy/ In Load balancing part, he mentioned that: We use SQF (shortest queue first) to distribute the load across the backends equally. Each backend will get the same number of connections. My

Re: quick question on innodb_log_file_size

2008-08-21 Thread Mark Leith
Jenny Chen wrote: Hi, According to the reference manual, it was said that the combined lnnodb log file size is less than 4G on 32-bit system. But I'm running on my 64-bit solaris, I still got the error complaining the innodb log file 4G for my 64-bit MySQL. So I'm wondering is this 4G limit

quick question on innodb_log_file_size

2008-08-20 Thread Jenny Chen
Hi, According to the reference manual, it was said that the combined lnnodb log file size is less than 4G on 32-bit system. But I'm running on my 64-bit solaris, I still got the error complaining the innodb log file 4G for my 64-bit MySQL. So I'm wondering is this 4G limit apply on 64-bit system

Re: another INNODB vs MYISAM question

2008-08-16 Thread Brent Baisley
calls in the my.ini file as well. As I half expected, all the databases that I had added INNODB tables failed when I tried to fire up the applications that used them. Although I am not new to mysql, I have had a bit of MYISAM tunnel vision with it so my question is, if I had just switched the default

RE: another INNODB vs MYISAM question

2008-08-16 Thread Martin Gainty
. Sender does not necessarily endorse content contained within this transmission. From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: another INNODB vs MYISAM question Date: Sat, 16 Aug 2008 08:52:51 -0400 CC: mysql@lists.mysql.com First, databases do not have a table type

Re: another INNODB vs MYISAM question

2008-08-15 Thread Doug Bridgens
question is, if I had just switched the default engine and NOT disabled the INNODB calls in my.ini, would that have prevented the problem? I restored all the MYISAM files and got everything back working again. I don't want to go through the lengthy reproduction exercise of reinstalling everything

encode/decode question

2008-08-15 Thread Duzenbury, Rich
that is the case. I did dump/restore the data in question from the 5.x back to a 4.x server, but it decodes in error as well. This obfuscation was a retrofit to an existing table, mostly of varchar fields. Another thought I had was that perhaps it's not a good idea to store binary data

another INNODB vs MYISAM question

2008-08-14 Thread mikesz
the default, I commented out all the INNODB calls in the my.ini file as well. As I half expected, all the databases that I had added INNODB tables failed when I tried to fire up the applications that used them. Although I am not new to mysql, I have had a bit of MYISAM tunnel vision with it so my question

WAMP question ...

2008-08-13 Thread mikesz
Hello and Greetings mysql, I have been running a WAMP server for some time on my Windows XP Pro box. Over time I have gone through some issues about which WAMP to use and last Year converted my Apache2Triad installation to WAMP5. All of my database installations, out of preference, have been

Re: WAMP question ...

2008-08-13 Thread Ananda Kumar
If you have both myisam and innodb. You need to ensure sql's from myisam and sql's from innodb have sufficient memory to run. you can allocate 25% of you RAM to key_buffer used exclusively for myisam and around 60% of your RAM to innodb_buffer_pool for supporting innodb . Also there are other

Join question

2008-07-31 Thread Andrej Kastrin
Dear all, I have two tables,let's call then a and b: Table a: CUI1|CUI2 C001|C002 C002|C003 C003|C055 C004|C002 ... Table b: CUI|STY C001|T001 C002|T002 C003|T003 C004|T004 C005|T006 C055|T061 .. And the join table should be: T001|T002 T002|T003 T003|T061 T004|T002 ... So,I should convert

Re: Join question

2008-07-31 Thread Jigal van Hemert
Dear all, I have two tables,let's call then a and b: Table a: CUI1|CUI2 C001|C002 C002|C003 C003|C055 C004|C002 ... Table b: CUI|STY C001|T001 C002|T002 C003|T003 C004|T004 C005|T006 C055|T061 .. And the join table should be: T001|T002 T002|T003 T003|T061 T004|T002

Re: Bulk INSERT performance question

2008-07-26 Thread Ananda Kumar
You can also set the bulk_insert_buffer_size=between 500MB TO 1GB, based on available RAM. This would improve bulk insert on myisam tables. regards anandkl On 7/26/08, mos [EMAIL PROTECTED] wrote: At 06:46 PM 7/25/2008, you wrote: List, I am bulk inserting a huge amount of data into a

Bulk INSERT performance question

2008-07-25 Thread Tobias Knaup
List, I am bulk inserting a huge amount of data into a MyISAM table (a wikipedia page dump). Before I issued SOURCE filename.sql; I did an ALTER TABLE page DISABLE KEYS; LOCK TABLES page WRITE; The dump consists of about 1,200 bulk INSERT statements with roughly 12,000 tuples each. For the

Re: Bulk INSERT performance question

2008-07-25 Thread mos
At 06:46 PM 7/25/2008, you wrote: List, I am bulk inserting a huge amount of data into a MyISAM table (a wikipedia page dump). Before I issued SOURCE filename.sql; I did an ALTER TABLE page DISABLE KEYS; LOCK TABLES page WRITE; The dump consists of about 1,200 bulk INSERT statements with

a question...

2008-07-23 Thread payne
Guys, I have been fighting with mysql trying to get it to only show every after the last dot(.) on a ip. for example instead geting 10.0.0.0 only get 10.0.0 But what every I try doesn't work. Can someone pls point to a web page where I can learn how to do it, of explain it here. Thanks. Payne

Re: a question...

2008-07-23 Thread Daniel Brown
On Wed, Jul 23, 2008 at 11:45 AM, [EMAIL PROTECTED] wrote: Guys, I have been fighting with mysql trying to get it to only show every after the last dot(.) on a ip. for example instead geting 10.0.0.0 only get 10.0.0 As pulled from a database row? Sorry, I didn't quite understand your

Re: a question...

2008-07-23 Thread payne
Yes, sorry. I have a database that records ip of attacks on a customer server, what I like to do get a count so that I can see what subnet is doing the major of the attacks. select ip from ipslimit 10; +-+---+ | ip | count(ip) | +-+---+

Re: a question...

2008-07-23 Thread Glyn Astill
I think you're after the SUBSTRING_INDEX(str,delim,count) function, so (I've not tried this): select substring_index(ip,'.',3) from ipslimit 10; --- On Wed, 23/7/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: From: [EMAIL PROTECTED] [EMAIL PROTECTED] Subject: Re: a question... To: Daniel

Re: a question...

2008-07-23 Thread Daniel Brown
On Wed, Jul 23, 2008 at 12:10 PM, [EMAIL PROTECTED] wrote: Yes, sorry. I have a database that records ip of attacks on a customer server, what I like to do get a count so that I can see what subnet is doing the major of the attacks. select ip from ipslimit 10;

Re: a question...

2008-07-23 Thread Mr. Shawn H. Corey
On Wed, 2008-07-23 at 12:10 -0400, [EMAIL PROTECTED] wrote: Yes, sorry. I have a database that records ip of attacks on a customer server, what I like to do get a count so that I can see what subnet is doing the major of the attacks. select ip from ipslimit 10;

Re: a question..

2008-07-23 Thread payne
PROTECTED] [EMAIL PROTECTED] Subject: Re: a question... To: Daniel Brown [EMAIL PROTECTED] Cc: [EMAIL PROTECTED], mysql@lists.mysql.com Date: Wednesday, 23 July, 2008, 5:10 PM Yes, sorry. I have a database that records ip of attacks on a customer server, what I like to do get a count so that I can

Re: [PHP] Re: a question...

2008-07-23 Thread Micah Gersten
I just want to point out that public IPs are no longer given out as Class A, B, and C networks, but based on CIDR. You can use rwhois to figure out who has use of a certain subnet and what the range of it is. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com

Re: Insert ... select ... On Duplicate Update Question

2008-07-21 Thread mos
At 08:23 PM 7/20/2008, Perrin Harkins wrote: On Sun, Jul 20, 2008 at 12:12 AM, mos [EMAIL PROTECTED] wrote: Is there a way to get Insert ... select ... On Duplicate Update to update the row with the duplicate key? That's what it does. Why can't it do this? What makes you think it can't?

Re: Insert ... select ... On Duplicate Update Question

2008-07-21 Thread Perrin Harkins
On Mon, Jul 21, 2008 at 11:44 AM, mos [EMAIL PROTECTED] wrote: I can't specify all of the columns in a Set statement in the OnDuplicate clause because I don't know what the column names are and there could be 100 columns. Write code to do it. There is no way around specifying the

Re: Insert ... select ... On Duplicate Update Question

2008-07-21 Thread mos
At 11:00 AM 7/21/2008, Perrin Harkins wrote: On Mon, Jul 21, 2008 at 11:44 AM, mos [EMAIL PROTECTED] wrote: I can't specify all of the columns in a Set statement in the OnDuplicate clause because I don't know what the column names are and there could be 100 columns. Write code to do

Re: Insert ... select ... On Duplicate Update Question

2008-07-21 Thread Phil
So just use REPLACE instead of INSERT... http://dev.mysql.com/doc/refman/5.0/en/replace.html On Mon, Jul 21, 2008 at 11:44 AM, mos [EMAIL PROTECTED] wrote: At 08:23 PM 7/20/2008, Perrin Harkins wrote: On Sun, Jul 20, 2008 at 12:12 AM, mos [EMAIL PROTECTED] wrote: Is there a way to get

Re: Insert ... select ... On Duplicate Update Question

2008-07-21 Thread mos
At 12:16 PM 7/21/2008, you wrote: So just use REPLACE instead of INSERT... Sure, but a Replace will delete the existing row and insert the new one which means also maintaining the indexes. This will take much longer than just updating the existing row. Now if there were only a couple of

Re: Insert ... select ... On Duplicate Update Question

2008-07-21 Thread Perrin Harkins
On Mon, Jul 21, 2008 at 2:43 PM, mos [EMAIL PROTECTED] wrote: I thought if MySQL found a duplicate key on the insert, it would automatically update the existing row that it found with the results from table1 if I left out the column expressions in the update clause. But apparently it doesn't

Re: Insert ... select ... On Duplicate Update Question

2008-07-20 Thread Perrin Harkins
On Sun, Jul 20, 2008 at 12:12 AM, mos [EMAIL PROTECTED] wrote: Is there a way to get Insert ... select ... On Duplicate Update to update the row with the duplicate key? That's what it does. Why can't it do this? What makes you think it can't? - Perrin -- MySQL General Mailing List For

Insert ... select ... On Duplicate Update Question

2008-07-19 Thread mos
Is there a way to get Insert ... select ... On Duplicate Update to update the row with the duplicate key? Otherwise I'll have to use Replace which is inefficient because it deletes the old duplicated row and then inserts the new row with the same key. I'd much rather have it update the

design question

2008-07-15 Thread robert rottermann
hi there, I am a casual database tinkerer that has to build a new database. so please do not fall down laughing if I ask stupid questions .. the problem at hand is that I want to create tables with the following structure: - suppliers they produce/deal-with 0 to n products - products a

Normalization / Foreign Key Question

2008-07-14 Thread Ben A. Hilleli
primary key. My question pertains to referrerID. The referrerID specifies which OTHER USER referred this new user. Thus it is a foreign key that links to a userID in another user record. I do not recall ever linking attributes from the same table (even for different records) so I have a hunch

delete query question

2008-07-08 Thread Jeff Mckeon
I think this is possible but I'm having a total brain fart as to how to construct the query.. Table2.ticket = table1.ID Table2 is a many to 1 relationship to table1 I need to delete all records from table1 where created unix_timestamp(date_sub(now(), interval 3 month)) And all rows from

Re: delete query question

2008-07-08 Thread Ian Simpson
If the tables are InnoDB, you could temporarily set up a foreign key relationship between the two, with the 'ON DELETE CASCADE' option. On Tue, 2008-07-08 at 11:14 -0400, Jeff Mckeon wrote: I think this is possible but I'm having a total brain fart as to how to construct the query..

RE: delete query question

2008-07-08 Thread Jeff Mckeon
-Original Message- From: Ian Simpson [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2008 11:27 AM To: Jeff Mckeon Cc: mysql@lists.mysql.com Subject: Re: delete query question If the tables are InnoDB, you could temporarily set up a foreign key relationship between the two

RE: delete query question

2008-07-08 Thread Ian Simpson
To: Jeff Mckeon Cc: mysql@lists.mysql.com Subject: Re: delete query question If the tables are InnoDB, you could temporarily set up a foreign key relationship between the two, with the 'ON DELETE CASCADE' option. Nope, MyISAM... On Tue, 2008-07-08 at 11:14 -0400, Jeff Mckeon

Re: delete query question

2008-07-08 Thread Peter Brawley
Jeff, Table2.ticket = table1.ID Table2 is a many to 1 relationship to table1 I need to delete all records from table1 where created unix_timestamp(date_sub(now(), interval 3 month)) And all rows from table2 where Table2.ticket = Table1.ID (of the deleted rows..) Like this (untested)?

RE: delete query question

2008-07-08 Thread Jeff Mckeon
Thanks, that did it! -Original Message- From: Peter Brawley [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2008 11:57 AM To: Jeff Mckeon Cc: mysql@lists.mysql.com Subject: Re: delete query question Jeff, Table2.ticket = table1.ID Table2 is a many to 1 relationship

Merge-table Question

2008-07-01 Thread Michael DePhillips
Hello, I remember some activity regarding some flakiness when using merge-tables. I searched out and reviewed this: http://bugs.mysql.com/bug.php?id=26881 Using 5.0.51a on RHEL 4 box, I'm still seeing similar issues. The INFORMATION_SCHEMA shows the merge table as follows TABLE_CATALOG:

Re: mysql - load data file question..

2008-06-28 Thread Ananda Kumar
can u please show use the content of the test.csv file. Also is comapny name a single column or two different columns If its two different columns than try this load data file '/foo/test.csv' into table abc.test fields terminated by ',' (company,name); On 6/28/08, bruce [EMAIL PROTECTED]

Re: Query - One-to-Many question

2008-06-27 Thread Tina Matter
Peter, Yes, I know there are two rows in the course_subject table with a catalog_number of 520. One has a subject of 'ME' and the other has a subject of 'MSE'. What I want is ONLY the 'ME' row (if a row exists with a subject of 'ME').If an 'ME' subject row does not exist, then I want

Re: Query - One-to-Many question

2008-06-27 Thread Peter Brawley
Tina What I want is ONLY the 'ME' row (if a row exists with a subject of 'ME'). If an 'ME' subject row does not exist, then I want the other one. I see. Then to complete spec, what behaviour is desired when there are two rows with 'ME', or two rows with (course_offer_number = 1 AND

Re: Query - One-to-Many question

2008-06-27 Thread Peter Brawley
What I want is ONLY the 'ME' row (if a row exists with a subject of 'ME'). If an 'ME' subject row does not exist, then I want the other one. Ill be offline for awhile so I'll assume answers not available, ie allow ='ME' dupes and 'ME' dupes if they exist. A one-query answer is to union (i)

Re: Query - One-to-Many question

2008-06-27 Thread Tina Matter
Peter, I really appreciate all the help. Unfortunately, the query you came up with still returns two rows for catalog_number = 520. I modified your query slightly to this to qualify a specific catalog_number: SELECT c.course_id,s.course_offer_number,s.subject FROM course c JOIN

mysql - load data file question..

2008-06-27 Thread bruce
Hi.. I've got an issue with doing a Load data file cmd.. my test text tbl has a column named company name i'm trying to figure out how to use the load data file cmd, to be able to extract the company name col... when i do: load data file '/foo/test.csv' into table abc.test (company name);

Query - One-to-Many question

2008-06-26 Thread Tina Matter
I have two tables: 1.) A course table (stores course_id and catalog_number) 2.) A course_subject table (stores course_id, catalog_number, subject, and course_offer_number) For each row in the course_table, there can be many rows in the course_subject table, due to cross-postings among

Re: Query - One-to-Many question

2008-06-26 Thread Peter Brawley
Tina Basically, if the subject is ME, then I want to select that row. If there is no row for that catalog_number that has a subject of ME, then I want to grab the row that has a course_offer_number of '1' and a subject that is not equal to ME. Is this what you mean? SELECT ... FROM

Re: Query - One-to-Many question

2008-06-26 Thread Tina Matter
Peter, That was the first query I tried, but for some reason, it still pulled all of the rows. So I've been trying to come up with another solution. Any other ideas? Thanks for the reply. Tina Peter Brawley wrote, On 6/26/08 2:12 PM: Tina Basically, if the subject is ME, then I want to

Re: Query - One-to-Many question

2008-06-26 Thread Peter Brawley
Tina, for some reason, it still pulled all of the rows Are there multiple rows which meet your WHERE condition? If so, and if you want just one of them, your need another WHERE condition. PB - Tina Matter wrote: Peter, That was the first query I tried, but for some reason, it still

Re: Query - One-to-Many question

2008-06-26 Thread Tina Matter
Even if I do a basic select (with no joins) for a given catalog_number, I still get two rows back. Even if I do this simple query, while hardcoding in a catalog_number: SELECT subject, catalog_number FROM course_subject WHERE (catalog_number = 520) AND ((subject = 'ME') OR

Re: Query - One-to-Many question

2008-06-26 Thread Peter Brawley
Tina, Even if I do this simple query, while hardcoding in a catalog_number: SELECT subject, catalog_number FROM course_subject WHERE (catalog_number = 520) AND ((subject = 'ME') OR ((course_offer_number = 1) AND (subject NOT LIKE 'ME'))) Errrm, you mean ...subject 'ME'..., don't you!? I

Maatkit question

2008-06-24 Thread Olaf Stein
Hi guys, This might be somewhat off topic but does anyone have experience with Baron Schwartz's maatkit, particulary with error messages? I have several databases on my master/slave setup and can use mk-table-checksum on almost all of them on both hosts. There are 3 databases where I get this

ERROR_FOR_DIVISION_BY_ZERO question

2008-06-20 Thread Paul Silevitch
Hello all, Currently, if I use sql_mode ERROR_FOR_DIVISION_BY_ZERO and have a select statement that has division by zero, I get back a warning: mysql set sql_mode=ERROR_FOR_DIVISION_BY_ZERO; Query OK, 0 rows affected (0.00 sec) mysql select 1/0; +--+ | 1/0 | +--+ | NULL | +--+ 1

Re: GROUP ORDER BY Question

2008-05-22 Thread Rob Wultsch
On Wed, May 21, 2008 at 9:45 PM, David Perron [EMAIL PROTECTED] wrote: Hello MySQL Users- I am pretty sure this is a simple question and I am over thinking how to solve the problem, so I am hoping the community can help. I am selecting a pretty straightforward aggregation from a single stats

Re: GROUP ORDER BY Question

2008-05-22 Thread Peter Brawley
Users- I am pretty sure this is a simple question and I am over thinking how to solve the problem, so I am hoping the community can help. I am selecting a pretty straightforward aggregation from a single stats table with the following format: SELECT Description LongDescription Detail

Re: A question about index

2008-05-21 Thread Paul McCullagh
On May 21, 2008, at 8:09 AM, Moon's Father wrote: Now I want to know which way you use to create index of a table. 1、ix_u (item_id,item_count) ix_item_count (item_count) This makes sense if you have queries which search item_id AND item_count, and queries which just search the column

Re: A question about index

2008-05-21 Thread Paul McCullagh
On May 21, 2008, at 8:46 AM, Paul McCullagh wrote: On May 21, 2008, at 8:09 AM, Moon's Father wrote: Now I want to know which way you use to create index of a table. 1、ix_u (item_id,item_count) ix_item_count (item_count) This makes sense if you have queries which search item_id AND

Re: A question about index

2008-05-21 Thread Moon's Father
Thanks for your reply very much. What I always use is the first way. But I also want to know if the following way is proper when I search item_id AND item_count and the column 'item_count'.? ix_item_id (item_id) ix_item_count (item_count) 2008/5/21 Paul McCullagh [EMAIL PROTECTED]: On

Re: A question about index

2008-05-21 Thread Moon's Father
Thanks very much. 2008/5/21 Paul McCullagh [EMAIL PROTECTED]: On May 21, 2008, at 8:46 AM, Paul McCullagh wrote: On May 21, 2008, at 8:09 AM, Moon's Father wrote: Now I want to know which way you use to create index of a table. 1、ix_u (item_id,item_count) ix_item_count (item_count)

GROUP ORDER BY Question

2008-05-21 Thread David Perron
Hello MySQL Users- I am pretty sure this is a simple question and I am over thinking how to solve the problem, so I am hoping the community can help. I am selecting a pretty straightforward aggregation from a single stats table with the following format: SELECT Description

Re: question about update/join query

2008-05-08 Thread Andy Wallace
= U.user_id) I would like to do it without a subquery, I thought that the multiple table syntax for UPDATE would do it, but I can't wrap my head around it. UPDATE user U, event_log L SET U.last_visit = MAX(L.event_time) WHERE U.user_id = L.user_id GROUP BY L.event_time I guess the main question is - CAN I

question about update/join query

2008-05-07 Thread Andy Wallace
Hey all - I have two tables - an event_log table, and a user table. There is a last_visit column in the user table, and I want to update it from the event_log with the most recent event timestamp. And I want to do it without a subquery, eventually, both these tables will be pretty large,

Re: question about update/join query

2008-05-07 Thread Andy Wallace
Clarification: I DON'T want to update the last_visit field if there is no matching event record... I managed to get this to sort of work: update enduser E set E.last_visit = (select MAX(EL.event_time) from event_log EL where EL.enduser_acnt =

Re: question about update/join query

2008-05-07 Thread Andy Wallace
in UPDATE statement? M - Original Message - From: Andy Wallace [EMAIL PROTECTED] To: mysql list mysql@lists.mysql.com Sent: Wednesday, May 07, 2008 1:07 PM Subject: Re: question about update/join query Clarification: I DON'T want to update the last_visit field if there is no matching event

Re: question about update/join query

2008-05-07 Thread Andy Wallace
like to do it without a subquery, I thought that the multiple table syntax for UPDATE would do it, but I can't wrap my head around it. UPDATE user U, event_log L SET U.last_visit = MAX(L.event_time) WHERE U.user_id = L.user_id GROUP BY L.event_time I guess the main question is - CAN I do

Re: question about update/join query

2008-05-07 Thread Andy Wallace
like to do it without a subquery, I thought that the multiple table syntax for UPDATE would do it, but I can't wrap my head around it. UPDATE user U, event_log L SET U.last_visit = MAX(L.event_time) WHERE U.user_id = L.user_id GROUP BY L.event_time I guess the main question is - CAN I do

PHP Question

2008-05-06 Thread Michael Condon
I have a PHP script that seems to be failing. I execute it using window.location.href(http://www.vote.com/vote2.php;): ?php $link = mysql_connect('localhost', 'login', 'password'); if (!$link) { die('Could not connect: ' . mysql_error()); } $result = use election if (!$result) { die('Could

Re: PHP Question

2008-05-06 Thread Salah Nait-Mouloud
Hi. try this ?php mysql_connect('localhost', 'login', 'password') or die('Could not connect: ' . mysql_error()); mysql_select_db(election) or die (Could not select election database); $result = mysql_query(update election set Votes = Votes + 1 where Name='TheGuy'); if (!$result) {

Re: PHP Question

2008-05-06 Thread Stut
On 6 May 2008, at 15:39, Michael Condon wrote: I have a PHP script that seems to be failing. I execute it using window.location.href(http://www.vote.com/vote2.php;): ?php $link = mysql_connect('localhost', 'login', 'password'); if (!$link) { die('Could not connect: ' . mysql_error()); }

RE: PHP Question

2008-05-06 Thread Jerry Schwartz
195 Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 www.the-infoshop.com www.giiexpress.com www.etudes-marche.com -Original Message- From: Michael Condon [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 06, 2008 10:39 AM To: mysql@lists.mysql.com Subject: PHP Question I

Re: PHP Question

2008-05-06 Thread Darryle steplight
. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 www.the-infoshop.com www.giiexpress.com www.etudes-marche.com -Original Message- From: Michael Condon [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 06, 2008 10:39 AM To: mysql@lists.mysql.com Subject: PHP Question I have a PHP

Re: Aggregation question

2008-04-24 Thread Sebastian Mendel
at this problem for the whole day and did not make much of a progress. If someone has any idea how to resolve this problem, I'll appreciate a tip greatly. a similar question was just answered on this list about 15 hours before your question ... http://lists.mysql.com/mysql/212457 -- Sebastian

Re: TO_DAYS Date Range Question

2008-04-24 Thread Sebastian Mendel
David Perron schrieb: Hello Users- I think I have an interesting question with regards to applying a function to date range, I think half of problem solving is explaining it to an audience so please, bear with me. There is a table Orders that has two DATE columns, StartDate and EndDate

Re: TO_DAYS Date Range Question

2008-04-24 Thread Sebastian Mendel
David Perron schrieb: Hi Sebastian- Wanted to follow up on this. I figured out the problem. You actually have to use the LEAST GREATEST operators when comparing multiple values, this statement works perfectly. LEAST(EndDays,Q2EndDays) - GREATEST(Q2StartDays,StartDays) as DaysInQ2,

Re: SQL question: find items tagged with specific tags

2008-04-23 Thread Ingo Weiss
Thanks, Sebastian! I have tried this one before. The problem is that it finds all items the tags of which include EITHER 'blue' OR 'red', not 'blue' AND 'red': mysql SELECT DISTINCT items.title from items inner join taggings on (items.id = taggings.item_id) inner join tags on (tags.id =

Re: SQL question: find items tagged with specific tags

2008-04-23 Thread Sebastian Mendel
Ingo Weiss schrieb: Thanks, Sebastian! I have tried this one before. The problem is that it finds all items the tags of which include EITHER 'blue' OR 'red', not 'blue' AND 'red': oh ... and ..., i missred SELECT DISTINCT items.* FROM items INNER JOIN taggings ON

TO_DAYS Date Range Question

2008-04-23 Thread David Perron
Hello Users- I think I have an interesting question with regards to applying a function to date range, I think half of problem solving is explaining it to an audience so please, bear with me. There is a table Orders that has two DATE columns, StartDate and EndDate. The range of dates can vary

Aggregation question

2008-04-23 Thread Gary Greenberg
I have a table that stores performed transactions and I need to build a histogram of a number of transactions per day in the requested period. So, I made a simple query with the group by clause which returns me what I need: 2008-04-16 65456204 2008-04-17 190838546 2008-04-18

Re: Aggregation question

2008-04-23 Thread Michael Cole
On Thursday 24 April 2008 12:26:09 pm Gary Greenberg wrote: except that there is no entry for April 20th as there were no transactions at that day. I need a query to return me zero for that day. I.e. I need uninterrupted sequence of dates. I am beating my head at this problem for the whole day

SQL question: find items tagged with specific tags

2008-04-22 Thread Ingo Weiss
Hi all, I have an application where items can be tagged. There are three tables 'items', 'taggings' and 'tags' joined together like this: items inner join taggings on (items.id = taggings.item_id) inner join tags on (tags.id = taggings.tag_id) Now I have been struggling for some time

Re: SQL question: find items tagged with specific tags

2008-04-22 Thread Sebastian Mendel
Ingo Weiss schrieb: Hi all, I have an application where items can be tagged. There are three tables 'items', 'taggings' and 'tags' joined together like this: items inner join taggings on (items.id = taggings.item_id) inner join tags on (tags.id = taggings.tag_id) Now I have been

Re: A SQL Query Question

2008-04-18 Thread Peter Brawley
userId long picture MeduimBlob datePosted DateTime A userId can have many pictures posted. I want to write a query that returns a distinct userId along with the most recent picture posted. Can someone suggest an elegant and fast query to accomplish this? Latest pic for user N: SELECT

A SQL Query Question

2008-04-17 Thread samk
See Thread at: http://www.techienuggets.com/Detail?tx=32975 Posted on behalf of a User Hello everyone, I have a table A: userId long picture MeduimBlob datePosted DateTime A userId can have many pictures posted. I want to write a query that returns a distinct userId along with the most

Re: A SQL Query Question

2008-04-17 Thread samk
See Thread at: http://www.techienuggets.com/Detail?tx=32975 Posted on behalf of a User select userId, picture, MAX(datePosted) from A order by datePosted; In Response To: Hello everyone, I have a table A: userId long picture MeduimBlob datePosted DateTime A userId can have many

Re: SQL query question for GROUP BY

2008-04-15 Thread Victor Danilchenko
I just thought of something else... could the same be accomplished using stored routines? I could find no way in MySQL to create stored routines which could be used with the 'group by' queries though. If this were possible, it should then be also possible to define a 'LAST' stored routine,

Re: SQL query question for GROUP BY

2008-04-15 Thread Perrin Harkins
On Fri, Apr 11, 2008 at 4:01 PM, Victor Danilchenko [EMAIL PROTECTED] wrote: Oooh, this looks evil. It seems like such a simple thing. I guess creating max(log_date) as a field, and then joining on it, is a solution -- but my actual query (not the abridged version) is already half a

update select question

2008-04-15 Thread Chris W
I have the following query... SELECT c.NLCID, n.publishdate FROM newsletter n JOIN newslettersection s using (NLID) JOIN newslettercontent c using(NLCID) WHERE contenttype = 1 AND n.publishdate AND c.`timestamp` = '-00-00 00:00:00' I want to run an update on newslettercontent and set its

Re: update select question

2008-04-15 Thread Sebastian Mendel
Chris W schrieb: I have the following query... SELECT c.NLCID, n.publishdate FROM newsletter n JOIN newslettersection s using (NLID) JOIN newslettercontent c using(NLCID) WHERE contenttype = 1 AND n.publishdate AND c.`timestamp` = '-00-00 00:00:00' I want to run an update on

Re: update select question

2008-04-15 Thread Ananda Kumar
update newslettercontent c set c.timestamp= (select n.publishdate from newsletter n where n.NLCID= c.NLCID); This should work. On 4/16/08, Chris W [EMAIL PROTECTED] wrote: I have the following query... SELECT c.NLCID, n.publishdate FROM newsletter n JOIN newslettersection s using (NLID)

SQL query question for GROUP BY

2008-04-11 Thread Victor Danilchenko
Hi all, I trying to run a query where, after doing a UNION on two different SELECTs, I need to sort the result by username and log_date fields, and then grab the last entry for each username ('last' as determined by the ordering of the log_date field, which is a datetime). GROUP

Re: SQL query question for GROUP BY

2008-04-11 Thread Rob Wultsch
On Fri, Apr 11, 2008 at 11:46 AM, Victor Danilchenko [EMAIL PROTECTED] wrote: GROUP BY seems like an obvious choice; 'GROUP BY username', to be exact. However, this seems to produce not the last row's values, but ones from a random row in the group. Under most databases your query is

Re: SQL query question for GROUP BY

2008-04-11 Thread Victor Danilchenko
Oooh, this looks evil. It seems like such a simple thing. I guess creating max(log_date) as a field, and then joining on it, is a solution -- but my actual query (not the abridged version) is already half a page long. I think at this point, unless someone else suggests a better solution,

Re: SQL query question for GROUP BY

2008-04-11 Thread Rob Wultsch
On Fri, Apr 11, 2008 at 1:01 PM, Victor Danilchenko [EMAIL PROTECTED] wrote: Oooh, this looks evil. It seems like such a simple thing. I guess creating max(log_date) as a field, and then joining on it, is a solution -- but my actual query (not the abridged version) is already half a

Question about mysql procedures

2008-04-11 Thread Joshua D. Drake
Hello, Can MySQL functions/stored procedures access database data? Joshua D. Drake -- The PostgreSQL Company since 1997: http://www.commandprompt.com/ PostgreSQL Community Conference: http://www.postgresqlconference.org/ United States PostgreSQL Association: http://www.postgresql.us/ Donate

Re: Question about mysql procedures

2008-04-11 Thread Rob Wultsch
On Fri, Apr 11, 2008 at 2:15 PM, Joshua D. Drake [EMAIL PROTECTED] wrote: Hello, Can MySQL functions/stored procedures access database data? Joshua D. Drake Yes. Is there something in particular you are looking to do? -- Rob Wultsch [EMAIL PROTECTED] wultsch (aim) -- MySQL General

Re: Question about mysql procedures

2008-04-11 Thread Paul DuBois
At 2:15 PM -0700 4/11/08, Joshua D. Drake wrote: Hello, Can MySQL functions/stored procedures access database data? Yes, with some limitations. You will want to read this section to see whether what you want to do is restricted:

Re: Question about mysql procedures

2008-04-11 Thread Joshua D. Drake
On Fri, 11 Apr 2008 14:52:30 -0700 Rob Wultsch [EMAIL PROTECTED] wrote: On Fri, Apr 11, 2008 at 2:15 PM, Joshua D. Drake [EMAIL PROTECTED] wrote: Hello, Can MySQL functions/stored procedures access database data? Joshua D. Drake Yes. Is there something in particular you are

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