Re: newbie join issue

2004-07-20 Thread Garth Webb
What is the 'idx' for when you already have an 'id' column? Also, you need an index on the column that you are joining on; having a single indexed column on a table doesn't automatically improve all queries against that table. Put an index on the 'email_address' fields of both tables. You'll ne

Re: MULTI-DELETE BUG when used WITH TABLE ALIASES (ver. mysql-4.1.3-beta-standard)

2004-07-19 Thread Garth Webb
1235468 Sep 5 2002 /lib/libc-2.2.93.so > > -rw-r--r--1 root root 2233342 Sep 5 2002 /usr/lib/libc.a > > -rw-r--r--1 root root 178 Sep 5 2002 /usr/lib/libc.so > > Configure command: ./configure '--prefix=/usr/local/mysql' &

Re: Why this query doesn't group the email addresses?

2004-07-13 Thread Garth Webb
artTable AS t3 WHERE > > > > t2.cart_id=t3.cart_id > > > > > AND t1.id=t2.customer_index AND > > t3.submitted='1' > > > > AND > > > > > t3.product_index='1' AND t3.quantity>0 > > > > > GROUP BY t1.email ORDER

Re: Why this query doesn't group the email addresses?

2004-07-13 Thread Garth Webb
gt; > > I'd be hard pressed to find every occurrence out > > of 1000 records, but I > > > DID quickly spot two exact same records which > > means the email address > > > was not grouped. > > > > > > What can I do or where did I go wrong? &g

Re: Select help

2004-07-01 Thread Garth Webb
7;s?? Yes. You need to count the number of times an IP appears and sort by that count, then limit it: SELECT ip, COUNT(ip) as num FROM iptable GROUP BY ip ORDER BY num DESC LIMIT 10 -- . Garth Webb . [EMAIL PROTECTED] . . shoes * éå * schoenen * ëí * chaussures * z

Re: sql join statement that I do not understand

2004-06-28 Thread Garth Webb
| recordid | int | > cs_com | [23] | > | basic | sorder | Relative Order | numeric| int | > | [23] | > | basic | con_type | Content Type:| recordid | int | > con_type | [23] | > +-++-

Re: Out of memory on INSERT

2004-06-17 Thread Garth Webb
7;top' while the script is running? MySQL has tweakable limits on how large a particular insert can be, but this error looks like perl is truely running out of memory, rather than being denied by MySQL. -- . Garth Webb . [EMAIL PROTECTED] . . shoes * éå * schoenen * ëí * chaussures * zapatos . S

Re: Multiple Databases

2004-06-17 Thread Garth Webb
for security; if one goes down, I'll have a > back up. > > Thanks. > > > > __ > Do you Yahoo!? > Yahoo! Mail is new and improved - Check it out! > http://promotions.yahoo.com/new_mail -- . Garth Webb . [EMA

Re: DBI and last_insert_id()

2004-06-15 Thread Garth Webb
You might have better luck with this on the [EMAIL PROTECTED] list, re: why this doesn't work. This works for me though: $pk = $dbh->{mysql_insertid}; On Mon, 2004-06-14 at 21:42, Daniel Kasak wrote: > Hi all. > > I'm writing an app in Perl / Gtk2, and I'm having trouble with DBI's > last_

Re: How to COUNT rows when they have a COUNT in them

2004-06-15 Thread Garth Webb
You could also try: SELECT owner, COUNT(*) FROM pet GROUP BY owner; SELECT FOUND_ROWS(); On Mon, 2004-06-14 at 20:41, Dave Torr wrote: > Thanks - this did not work for me as I am on 4.0.17 - presumably this works > on 4.1 (seems to need the SubQuery feature)? If so I will upgrade > imme

Re: Query question

2004-05-24 Thread Garth Webb
> > part ... > > > > - hcir > > That's what I needed. Thanks! Note that this solution will be off by one if there aren't any zeros in your data. Try this: select count(IF(field>0,NULL,1)) + count(distinct IF(field>0,field,NULL)) from test; -- .

Re: Table Relation Design Question

2004-05-20 Thread Garth Webb
n key back to the correct table... > > > > And should I have a table that links orgs and events and contacts and > events, or should I have one lookup table > > That relates them all together, i.e. orgs contacts, and events..? > > > > To simplify, is It

Re: INSERT table1 SET col1 = table2.col1

2004-05-17 Thread Garth Webb
> use the SET syntax so I could list all my old fields right > next to my new fields, so that I didn't have to > skip up and down 40 lines to see how I have them matched up. > > So does INSERT ... SET ... work? How? > > -Paul > > -- . Garth Webb . [EMAIL PROTECTE

Re: Need Table Joins Example

2004-05-17 Thread Garth Webb
you are successful at that, and you still think Dreamweaver will save you time, then move to using Dreamweaver to create your pages. Only after you've figured out all the intermediate steps will it be possible to fix the code dreamweaver outputs when it goes wrong. Garth -- . Garth Webb

Re: Querying rows between two strings

2004-05-11 Thread Garth Webb
first example you'd use: SELECT * FROM names WHERE username BETWEEN 'a' and 'ld' AND first_name BETWEEN 'al' and 'leao' Note that for the end condition of each comparison the last letter is increased by one letter so that it complete

Re: newbie data import question

2004-05-06 Thread Garth Webb
On Thu, 2004-05-06 at 07:24, luther van dam wrote: > I am new to MySQL but I some basic database experience. > I have about 50,000 rows of data in a CSV file. > > Where I can find some examples of SQL scripts that show how to: > a. Create a database X. > b. Create a table Y. > c. Import the 50,

Re: urban myth?

2004-05-03 Thread Garth Webb
n't the same every time, but in an arbitrary database specific order, they might as well be random. > bob > At 12:55 PM 5/3/2004, Garth Webb wrote: > >On Mon, 2004-05-03 at 10:39, Boyd E. Hemphill wrote: > > > My boss says that if you do a select statement against a table the

Re: urban myth?

2004-05-03 Thread Garth Webb
On Mon, 2004-05-03 at 10:39, Boyd E. Hemphill wrote: > My boss says that if you do a select statement against a table the > result set always comes back in the same order. I say that this is a > myth and that the result is random, except when some ordering is > specified in the SQL statement. > >

Re: Create a table from SHOW TABLE STATUS ?

2004-04-30 Thread Garth Webb
On Fri, 2004-04-30 at 06:03, Richard A. DeVenezia wrote: > I'm running 4.1.1a-alpha-max-nt using innodb tables with foreign keys . > I know how to use SHOW TABLE STATUS to see the referential linkages in the > COMMENT column. > > Supppose I am typing away in MySQL monitor: > Q: Is there a way to

Re: simplifying OR clauses

2004-04-26 Thread Garth Webb
On Mon, 2004-04-26 at 14:59, Matthias Eireiner wrote: > hi there, > > I have a basic question: > how can I simplify multiple OR statements in a WHERE clause where I have > only one column to which I refer? > > e.g. > > SELECT word FROM word_table WHERE id = 1 OR id = 34 OR id = 78 OR id = 8787

Re: SQL Query Question

2004-04-16 Thread Garth Webb
ther than a string, so it > has MMDDHHMMSS values. So it looks like I'll need to do some type of > substring on it. You could keep any index you have and do it this way: SELECT a,b FROM x WHERE queue_time BETWEEN date_format(curdate(), "%Y%m%e00") AND date_format(curdate(), "%Y%m%e235959"); -- |- Garth Webb -| |- [EMAIL PROTECTED] -| signature.asc Description: This is a digitally signed message part

RE: Error ?

2004-04-15 Thread Garth Webb
r list archives: http://lists.mysql.com/mysql > To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] > > > > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] > > -- |- Garth Webb -| |- [EMAIL PROTECTED] -| signature.asc Description: This is a digitally signed message part

Re: How can I detect the end of a replication cycle?

2004-04-13 Thread Garth Webb
ce condition is to lock your tables, but your program running on the slave database would have to be able to connect to the master. Your slave program would lock the necessary tables on the master side, wait to receive the lock, wait until the slave had caught up, do your merge, then release the lock.

Re: How can I detect the end of a replication cycle?

2004-04-13 Thread Garth Webb
c, and may not be > compatible with future versions of MySQL to be a good choice.) Please help! > > > Thanks in advance! > Shawn > [EMAIL PROTECTED] > > ** delete all the parts with "no" in them to reveal my real address. ** -- |- Garth Webb -| |- [EMAIL PROTECTED] -| signature.asc Description: This is a digitally signed message part

Re: Get MySQL to ignore the backslashes?

2004-04-12 Thread Garth Webb
e. Just the Net You Need. > > New! Netscape Toolbar for Internet Explorer > Search from anywhere on the Web and block those annoying pop-ups. > Download now at http://channels.netscape.com/ns/search/install.jsp -- |- Garth Webb -| |- [EMAIL PROTECTED] -| signature.asc Description: This is a digitally signed message part

Re: Am I doing things right? (selecting groups of objects problems)

2004-04-09 Thread Garth Webb
ehow I am feeling there is a better way to > do all this... This has the same problems as the LIKE '%100%203%' approach, but a full text search is replaced by math on each row. In both cases you lose the ability to use any kind of index. > Sorry for this long letter I hope I hav

Re: Need help creating table...

2004-04-06 Thread Garth Webb
t 5 > > > > Length/Values > > 5 > > > > Charset > > Latin1 > > > > Attributes > > unsigned > > > > Null > > Not_null > > > > Default** > > ? > > > > Extra > > auto_increment > > > > I'm not sure what to enter for Default**. Can someone tell me what I'm > missing? > > I'm using MySQL5.0alpha w/PHP4.3.4 on W2K3. > > > > Thanks > > -- |- Garth Webb -| |- [EMAIL PROTECTED] -| signature.asc Description: This is a digitally signed message part

Re: Sorting with an alpha numeric field.

2004-03-23 Thread Garth Webb
u will not lose data when you sort. So what exactly is your question? A question ans some examples of things you have tried already would help. -- |- Garth Webb -| |- [EMAIL PROTECTED] -| signature.asc Description: This is a digitally signed message part

Re: A join I can not wrap my head around...

2004-03-15 Thread Garth Webb
= 'TX' AND transaction.added between '20030101000000' and '20031231235959'; ? -- |- Garth Webb -| |- [EMAIL PROTECTED] -| signature.asc Description: This is a digitally signed message part

Re: Reversing the group...

2004-03-08 Thread Garth Webb
t pageid, count(pageid) as count from first group by pageid order by count; > BUT how do I get the last page they have visited? a sort of reverse GROUP BY??? > Which would return... > > pageidcount > 42 > 21 > > Please Help its driving me nuts :S If you want the last page seen, then you could change the 'min' to a 'max' in the statements above. -- |- Garth Webb -| |- [EMAIL PROTECTED] -| signature.asc Description: This is a digitally signed message part

Re: Changing default delimiter

2004-02-23 Thread Garth Webb
rron wrote: > Greetings - > Been scouring the docs for this all day and I come up with nothing for > 'delimiter' - Id like to change the default delimiter in mysql to something > other than tab. > Is there a command to do this, and what are the options? > > Thank

Re: [Slightly OT] Tricky SQL Query

2004-02-17 Thread Garth Webb
t this: select Unit, sum(InputOctets), sum(OutputOctets) from your_table where date between '2004-02-01 00:00:00' and '2004-02-29 23:59:55' group by Unit; -- |- Garth Webb -| |- [EMAIL PROTECTED] -| signature.asc Description: This is a digitally signed message part

Inconsistant TIMESTAMP behavoir

2004-02-13 Thread Garth Webb
. Some final notes. While this problem may have existed previously, I only noticed it when I began deleting old log data by date via a script. Furthermore, only the first 2000 or so earliest dates cannot be selected. All dates after this 'blackout' period can be selected without a problem. -- |- Garth Webb -| |- [EMAIL PROTECTED] -| signature.asc Description: This is a digitally signed message part