Help regarding a simple query

2006-03-13 Thread VenuGopal Papasani
Hi, I am searching for a query where i can have pattern matching without considering the cases.You can consider the following example for detailed description of what i want exactly. Let my table X consists of following data Name --- venu venup venugopla VenugOpal VENU

RE: Help regarding a simple query

2006-03-13 Thread Jeff
-Original Message- From: VenuGopal Papasani [mailto:[EMAIL PROTECTED] Sent: Monday, March 13, 2006 10:33 To: mysql@lists.mysql.com Subject: Help regarding a simple query Hi, I am searching for a query where i can have pattern matching without considering the cases.You can

Re: Help regarding a simple query

2006-03-13 Thread Peter Brawley
Now i need to get all the records which consists of the string venu(case should not be considered either case should be).i.e i should get 1,2,3,4,5,8 records A simple way is ... ... WHERE LOCATE('venu', col_name ) 0 ... or if the column is [VAR]BINARY, LOCATE('venu',CAST(col_name AS

RE: Help regarding a simple query

2006-03-13 Thread Jeff
-Original Message- From: VenuGopal Papasani [mailto:[EMAIL PROTECTED] Sent: Monday, March 13, 2006 11:48 To: Jeff Subject: Re: Help regarding a simple query Hi Jeff, This is venu again.Last mail i did not include a constraint that is what irritating me most.Actually if i got venu-kkk

A lil help with a simple query...

2002-08-02 Thread Alex Behrens
Hi Guys, I'm still new to this and I'm trying to get back into and I need help with a simple query. I have a list of info about a product for an article on my website and I'm pulling all this info from a mysql db and displaying it byway of php but don't know how to do the query. Right now I have

help with a simple query..

2002-08-02 Thread Alex Behrens
Hi Guys, I'm still new to this and I'm trying to get back into and I need help with a simple query. I have a list of info about a product for an article on my website and I'm pulling all this info from a mysql db and displaying it byway of php but don't know how to do the query. Right now I have

Re: help with a simple query..

2002-08-02 Thread Bhavin Vyas
SELECT * from hwu_articles WHERE id = '$id' and price is not null and name is not null and ratings is not null; Bhavin. - Original Message - From: Alex Behrens [EMAIL PROTECTED] To: MYSQL [EMAIL PROTECTED] Sent: Friday, August 02, 2002 4:49 PM Subject: help with a simple query.. Hi

Help with a simple query ..

2001-08-20 Thread Chad Day
I have 2 tables: bases, and properties base has a ZIPCODE field in the table, as does the properties table. I'm trying to find all bases that do NOT have a property in that zip code. What I've tried is: select distinct cb.*, cp.* from classified_bases as cb left join classified_properties as

RE: Help with a simple query ..

2001-08-20 Thread Carsten H. Pedersen
I have 2 tables: bases, and properties base has a ZIPCODE field in the table, as does the properties table. I'm trying to find all bases that do NOT have a property in that zip code. What I've tried is: The general answer: http://www.bitbybit.dk/mysqlfaq/faq.html#ch7_10_0 In your case,

Re: Help with a simple query ..

2001-08-20 Thread David Turner
Try this. I couldn't find if MYSQL supports not in's so I followed there outer joins. You can read up on in in the mysql manual, do a search on outer joins. select base.zipcode,properties.zipcode from base right join properties on base.zipcode=properties.zipcode where base.zipcode is null; On

Re: Need help optimizing this (simple) query

2001-03-13 Thread Jordan Russell
Hi, Ok, I'm out of ideas. The additional index should have sped things up, not slowed them down. I've got some tables with 26,000 rows in it and I do 4 joins (using a WHERE clause) with smaller tables without a hitch. Sorry I can't help. But thanks a lot for trying. :) And thanks also to

Need help optimizing this (simple) query

2001-03-12 Thread Jordan Russell
Hi everyone, I'm stuck on one issue which is preventing me from using MySQL in production on one particular database. (This is similar to my last post but this time I'll explain better what I'm attempting to do.) I'm trying to create a database of filenames and directories using MySQL. I have

Re: Need help optimizing this (simple) query

2001-03-12 Thread Gerald L. Clark
A .03 sec left join PREVENTS you from using MySQL. This must be a troll. You have no where clause, so no index is used. Jordan Russell wrote: Hi everyone, I'm stuck on one issue which is preventing me from using MySQL in production on one particular database. (This is similar to my last

Re: Need help optimizing this (simple) query

2001-03-12 Thread Jordan Russell
A .03 sec left join PREVENTS you from using MySQL. This must be a troll. Sigh... I guess I failed to mention this was a deliberately simplified example in order to pose my question in a easy-to-understand manner. In reality, there are much more records, and a more complex query, where the

Re: Need help optimizing this (simple) query

2001-03-12 Thread Jordan Russell
You have no where clause, so no index is used. Oops, missed this part. Where exactly do I need a WHERE clause, and for what? The first query doesn't have a WHERE clause and yet it appears to be using the "date" index. Jordan Russell

Re: Need help optimizing this (simple) query

2001-03-12 Thread Jordan Russell
Hi, Thanks for the reply. Hve you read http://www.mysql.com/documentation/mysql/bychapter/manual_Performance.html#L EFT_JOIN_optimization ? Yes, many times, as well as just about everything else in the Performance chapter. Am I missing something totally obvious? Should I even be using a LEFT

RE: Need help optimizing this (simple) query

2001-03-12 Thread Cal Evans
were your results? Cal http://www.calevans.com -Original Message- From: Jordan Russell [mailto:[EMAIL PROTECTED]] Sent: Monday, March 12, 2001 2:27 PM To: Cal Evans Cc: [EMAIL PROTECTED] Subject: Re: Need help optimizing this (simple) query Hi, Thanks for the reply. Hve you read http

Re: Need help optimizing this (simple) query

2001-03-12 Thread Jordan Russell
Everything I've seen on this list indicates that using LEFT JOIN negates using an index. (WARNING: This is 3rd hand info and as such should be viewed skeptically!) Have you tried: SELECT files.id, dirs.name FROM files where files.dir_id=dirs.id ORDER BY files.date DESC LIMIT 1; If so,

RE: Need help optimizing this (simple) query

2001-03-12 Thread Cal Evans
(dir_id), to the above. Cal http://www.calevans.com -Original Message- From: Jordan Russell [mailto:[EMAIL PROTECTED]] Sent: Monday, March 12, 2001 2:48 PM To: Cal Evans Cc: [EMAIL PROTECTED] Subject: Re: Need help optimizing this (simple) query Everything I've seen on this list indicates

Re: Need help optimizing this (simple) query

2001-03-12 Thread Steve Ruby
Jordan Russell wrote: Everything I've seen on this list indicates that using LEFT JOIN negates using an index. (WARNING: This is 3rd hand info and as such should be viewed skeptically!) Have you tried: SELECT files.id, dirs.name FROM files where files.dir_id=dirs.id ORDER BY

Re: Need help optimizing this (simple) query

2001-03-12 Thread Jordan Russell
/* This table has 5000 rows */ CREATE TABLE files ( id int(11) NOT NULL auto_increment, dir_id int(11) NOT NULL default '0', name varchar(100) NOT NULL default '', date datetime default NULL, PRIMARY KEY (id), KEY date (date) ) TYPE=MyISAM; for grins and giggles, add: key

RE: Need help optimizing this (simple) query

2001-03-12 Thread Cal Evans
Message- From: Jordan Russell [mailto:[EMAIL PROTECTED]] Sent: Monday, March 12, 2001 3:07 PM To: Steve Ruby Cc: Cal Evans; [EMAIL PROTECTED] Subject: Re: Need help optimizing this (simple) query Do you have an index on files that starts with dir_id and an index on dirs that stats with id