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

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

RE: query counts of a database

2008-06-13 Thread Boyd, Todd M.
-Original Message- From: Elim Qiu [mailto:[EMAIL PROTECTED] Sent: Friday, June 13, 2008 10:56 AM To: mysql@lists.mysql.com Subject: query counts of a database I'm looking for a query that reports the count of each table in the database. the query should not assume the table list

RE: query counts of a database

2008-06-13 Thread Rolando Edwards
If you are using MySQL 5.0 or later, use the INFORMATION_SCHEMA database. It has an in-memory table of table names called (as you would expect) 'tables'. SELECT table_rows,table_name FROM information_schema.tables WHERE table_schema = 'whatever database you choose'; If you are using a current

Re: query counts of a database

2008-06-13 Thread Elim Qiu
PROTECTED] To: Elim Qiu [EMAIL PROTECTED]; mysql@lists.mysql.com Sent: Friday, June 13, 2008 10:02 AM Subject: RE: query counts of a database -Original Message- From: Elim Qiu [mailto:[EMAIL PROTECTED] Sent: Friday, June 13, 2008 10:56 AM To: mysql@lists.mysql.com Subject: query counts

Re: query counts of a database

2008-06-13 Thread Elim Qiu
Thanks a lot Edwards! I'm using MySQL 5.1. Your query works great! - Original Message - From: Rolando Edwards [EMAIL PROTECTED] To: Elim Qiu [EMAIL PROTECTED]; mysql@lists.mysql.com Sent: Friday, June 13, 2008 10:32 AM Subject: RE: query counts of a database If you are using MySQL 5.0

Re: Query Output Issue

2008-05-24 Thread mdimartino
- Original Message - From: Rob Wultsch [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: MYSQL General List mysql@lists.mysql.com Sent: Friday, May 23, 2008 1:42:07 PM GMT -08:00 US/Canada Pacific Subject: Re: Query Output Issue On Fri, May 23, 2008 at 1:35 PM, Rob Wultsch [EMAIL PROTECTED

Re: Query Output Issue

2008-05-24 Thread Rob Wultsch
On Fri, May 23, 2008 at 3:06 PM, [EMAIL PROTECTED] wrote: - Original Message - From: Rob Wultsch [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: MYSQL General List mysql@lists.mysql.com Sent: Friday, May 23, 2008 11:10:56 AM GMT -08:00 US/Canada Pacific Subject: Re: Query Output Issue

Re: Query Output Issue

2008-05-24 Thread Rob Wultsch
On Fri, May 23, 2008 at 1:35 PM, Rob Wultsch [EMAIL PROTECTED] wrote: SELECT p1.POPS AS `POPA`, p2.POPS AS `POPZ` FROM circuits INNER JOIN pops.POPS as p1 WHERE circuits.popID_A =p1.popID INNER JOIN pops.POPS as p2 WHERE circuits.pop_ID_Z =p2.popID Wow... I can't believe I wrote that

Re: Query Output Issue

2008-05-23 Thread Rob Wultsch
On Fri, May 23, 2008 at 11:27 AM, [EMAIL PROTECTED] wrote: I have a table that has two has two secondary keys referencing the same primary key of another. Table-name =Circuits circuitID CircuitID A_loc Z_loc Table-name = Location locationID location

Re: Query Output Issue

2008-05-23 Thread mdimartino
Pacific Subject: Re: Query Output Issue On Fri, May 23, 2008 at 11:27 AM, [EMAIL PROTECTED] wrote: I have a table that has two has two secondary keys referencing the same primary key of another. Table-name =Circuits circuitID CircuitID A_loc Z_loc Table-name

Re: Query Output Issue

2008-05-23 Thread Rob Wultsch
On Fri, May 23, 2008 at 12:04 PM, [EMAIL PROTECTED] wrote: Thanks for the quick reply, however i am getting a failure on line 2. SELECT 11.POPS AS `POPA`, 12.POPS AS `POPZ` FROM circuits INNER JOIN pops.POPS as 11 WHERE circuits.popA = 11.popID INNER JOIN pops.POPS as 12 WHERE

Re: Query Output Issue

2008-05-23 Thread mdimartino
Subject: Re: Query Output Issue On Fri, May 23, 2008 at 12:04 PM, [EMAIL PROTECTED] wrote: Thanks for the quick reply, however i am getting a failure on line 2. SELECT 11.POPS AS `POPA`, 12.POPS AS `POPZ` FROM circuits INNER JOIN pops.POPS as 11 WHERE circuits.popA = 11.popID INNER JOIN

Re: Query Output Issue

2008-05-23 Thread Rob Wultsch
On Fri, May 23, 2008 at 1:47 PM, [EMAIL PROTECTED] wrote: Still getting and error on the last line SELECT p1.POPS AS `POPA`, p2.POPS AS `POPZ` FROM circuits INNER JOIN pops.POPS as p1 WHERE circuits.popID_A =p1.popID INNER JOIN pops.POPS as p2 WHERE circuits.pop_ID_Z =p2.popID I

Re: Query Output Issue

2008-05-23 Thread mdimartino
- Original Message - From: Rob Wultsch [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: MYSQL General List mysql@lists.mysql.com Sent: Friday, May 23, 2008 11:10:56 AM GMT -08:00 US/Canada Pacific Subject: Re: Query Output Issue On Fri, May 23, 2008 at 1:47 PM, [EMAIL PROTECTED] wrote

Re: Query execution time - MySQL

2008-05-14 Thread Craig Huffstetler
Greetings Niel, Not much detail there (but I'll go off what you provided...). Some people limit the actual MySQL system for times it TAKES MySQL to execute queries. For THIS to be accomplished, MySQL has built-in functionality to measure the time is takes queries to take place so it can ... limit

RE: Query execution time - MySQL

2008-05-14 Thread Neil Tompkins
the query actually took or do I need to do this outside of my query. Regards Neil Date: Wed, 14 May 2008 07:21:04 -0400From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: Re: Query execution time - MySQLCC: [EMAIL PROTECTED] Niel,Not much detail there (but I'll go off what you provided...). Some people limit

Re: Query execution time - MySQL

2008-05-14 Thread Ben Clewett
actually took or do I need to do this outside of my query. Regards Neil Date: Wed, 14 May 2008 07:21:04 -0400From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: Re: Query execution time - MySQLCC: [EMAIL PROTECTED] Niel,Not much detail there (but I'll go off what you provided...). Some people limit

Re: Query execution time - MySQL

2008-05-14 Thread Ben Clewett
: [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: [EMAIL PROTECTED]; mysql@lists.mysql.com Subject: Re: Query execution time - MySQL If you using C++ then you can use this: http://developer.gimp.org/api/2.0/glib/glib-Timers.html I use this in my code, does an excelent job. Also you

RE: Query execution time - MySQL

2008-05-14 Thread Neil Tompkins
@lists.mysql.com Subject: Re: Query execution time - MySQL Hi Neil, If your using Linux then you have to install the glib RPM's in the usual way. I don't know about other platforms, but I am sure there will be a version of glib out there... Also ensure the correct include and link directives

RE: Query execution time - MySQL

2008-05-14 Thread Neil Tompkins
Thanks for your help. In the end I've decided to use GetTickCount() Neil Date: Wed, 14 May 2008 13:44:22 +0100 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: mysql@lists.mysql.com Subject: Re: Query execution time - MySQL Hi Neil, If your using Linux then you have to install

Re: Query execution time - MySQL

2008-05-14 Thread Eric Frazier
Neil Tompkins wrote: Thanks for your help. In the end I've decided to use GetTickCount() Neil Date: Wed, 14 May 2008 13:44:22 +0100 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: mysql@lists.mysql.com Subject: Re: Query execution time - MySQL Hi Neil, If your using Linux then you

Re: Query/Key Optimization

2008-05-06 Thread Michael Stearne
As a note. The query itself may not be taking long but there are many Sorting result and Copying to tmp table in myTop. Thanks, Michael On Tue, May 6, 2008 at 3:26 PM, Michael Stearne [EMAIL PROTECTED] wrote: Hi. The main table for our site is called properties and it gets hit quite

Re: Query/Key Optimization

2008-05-06 Thread Krishna Chandra Prajapati
Hi The query is not optimized as it is scanning 45048 rows. Vertical partitioning can be used because there is a lot of column in single table. On Tue, May 6, 2008 at 3:26 PM, Michael Stearne [EMAIL PROTECTED] wrote: Hi. The main table for our site is called properties and it gets hit quite

Re: Query OK in localhost, error on ISP server

2008-04-17 Thread contiw
Complementing the post above: I have found that SUM(DISTINCT xxx) is valid with v.5x, not so in v.4x. While I am trying to convince my ISP to switch the database to a v.5x server, I would like some help with a workaround - please excuse my newbness. I have tried : (select

Re: Query OK in localhost, error on ISP server

2008-04-17 Thread contiw
Complementing the post above: I have found that SUM(DISTINCT xxx) is valid with v.5x, not so in v.4x. While I am trying to convince my ISP to switch the database to a v.5x server, I would like some help with a workaround - please excuse my newbness. I have tried : (select

Re: Query problem

2008-04-16 Thread Daniel Brown
On Wed, Apr 16, 2008 at 4:35 AM, sivasakthi [EMAIL PROTECTED] wrote: Hi all, Iam having the one table name called AccessDetails and data inside that tables is following, [snip=schema] In that , I need to calculate the number of total sites , number of total Accessed Sites,number of

Re: Query Confusion!

2008-04-12 Thread Brent Baisley
Is the plus query return more then 50% of the records? If so, MySQL won't return anything since the result set isn't that relevant. Brent Baisley Systems Architect On Apr 11, 2008, at 8:08 AM, Barry wrote: I am confused ( nothing new there), what I thought was a simple search is proving

Re: Query Confusion!

2008-04-12 Thread Barry
There are only 500 records in total of which three are relevant to the 'plus' query. But there is only 1 relevant result from the 'real' query, and that did return a result. Brent Baisley wrote: Is the plus query return more then 50% of the records? If so, MySQL won't return anything

Re: Query runs very sloooow

2008-04-11 Thread Johan Solve
A late followup on this, so I top post to keep the history intact. The composite primary key was the problem. Or rather, the missing individual indexes for tag_id and ad_id. We also changed to INNER JOINs instead, but that didn't affect the performance. Thanks for all suggestions! On

Re: Query runs very sloooow

2008-03-05 Thread Baron Schwartz
Hi, On Wed, Mar 5, 2008 at 9:11 AM, Johan Thorvaldsson [EMAIL PROTECTED] wrote: I need help to optimize this following query. It runs very slow and I cant find any direct errors in it. SELECT 1 * t1.termfreq as viktatantal, t1.tag, t1.url FROM tag_keys t1 LEFT JOIN tag_ad_map tm1 ON

Re: Query runs very sloooow

2008-03-05 Thread Johan Thorvaldsson
Thanks baron for you reply. Here is the result from the explain: 1 SIMPLE t2 ref PRIMARY,url url 194 const 1 Using where; Using temporary; Using filesort 1 SIMPLE tm1 index PRIMARY PRIMARY 8 NULL 149115 Using index 1 SIMPLE t1 eq_ref PRIMARY,url PRIMARY 4 rubbetdev.tm1.tag_id 1 Using where 1

Re: Query runs very sloooow

2008-03-05 Thread Johan Thorvaldsson
CREATE TABLE structure looks like this: CREATE TABLE `tag_ad_map` ( `ad_id` int(11) NOT NULL default '0', `tag_id` int(11) NOT NULL default '0', `termfreq` int(11) NOT NULL default '0', PRIMARY KEY (`tag_id`,`ad_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 CREATE TABLE `tag_keys` (

Re: Query runs very sloooow

2008-03-05 Thread Rob Wultsch
Also you have a composite key on for the prymary key in tag_keys . ad_id should probably be a seperate index for LEFT JOIN tag_ad_map tm2 ON tm1.ad_id = tm2.ad_id to join well. The Index should be ignored because the left most portion of the the index is not used... On 3/5/08, Rob Wultsch [EMAIL

Re: Query runs very sloooow

2008-03-05 Thread Rob Wultsch
From a brief glance: 1 * seems odd to me. Is this an attempt at some sort of cast? ORDER BY viktatantal DESC, RAND() LIMIT 80 How many results would this return without the limit. The ORDER BY RAND() will never help a query. All the possible results have to be computed... Do you mean LEFT

Re: Query two different databases for differences

2008-02-11 Thread Peter Brawley
James; This finds common rows. Eh!? ... HAVING COUNT(*)=1 returns ONLY pairs that are different: drop table if exists a,b; create table a(i int,j int,k int); insert into a values(1,10,100),(2,20,200),(3,30,300); create table b select * from a; update b set k=301 where k=300; select * from a;

Re: Query two different databases for differences

2008-02-11 Thread James Eaton
From: Peter Brawley I'd like to run a query to find the records that are present in one database but not the other. See 'Compare data in two tables' at http://www.artfulsoftware.com/infotree/queries.php. Thanks. That's a start. SELECT MIN(TableName) as TableName, id, col1, col2, col3,

Re: Query two different databases for differences

2008-02-11 Thread BJ Swope
On Feb 11, 2008 7:27 PM, James Eaton [EMAIL PROTECTED] wrote: SELECT MIN(TableName) as TableName, id, col1, col2, col3, ... FROM ( SELECT 'Table a' as TableName, a.id, a.col1, a.col2, a.col3, ... FROM a UNION ALL SELECT 'Table b' as TableName, b.id, b.col1, b.col2, b.col3, ... FROM

Re: Query two different databases for differences

2008-02-11 Thread Peter Brawley
James I'd like to run a query to find the records that are present in one database but not the other. See 'Compare data in two tables' at http://www.artfulsoftware.com/infotree/queries.php. PB James Eaton wrote: I have two different databases on the same 5.0 server that have the same

Re: Query optimization

2008-01-22 Thread Joris Kinable
-What I'am trying to do: Bit hard to explain. I've got a table consisting of ip addresses (ipv4_src), destination addresses (ipv4_dst), and port numbers (port_dst) and some other irrelevant columns. Ultimately my goal is to find a linear order in a subset of ports. For example, host A connects to

Re: Query optimization

2008-01-21 Thread Sebastian Mendel
Joris Kinable schrieb: Optimize query I've got one query, which I would like to improve a lot since it takes very long (24 hours) to execute. Here is the idea: 1. Take the table ipv4_srcipv4_dstport_dst (other rows in this table are not mentioned for clearity) and remove all duplicate tuple's.

Re: Query help, please..

2007-12-11 Thread Rob Wultsch
On Dec 11, 2007 8:38 AM, Anders Norrbring [EMAIL PROTECTED] wrote: I'm looking at a situation I haven't run into before, and I'm a bit puzzled by it. I have this table structure: Table USERS: userid, class Table OBJECT: userid, class, result Now I want to query the database for a certain

Re: Query help, please..

2007-12-11 Thread Jason Pruim
On Dec 11, 2007, at 10:46 AM, Rob Wultsch wrote: On Dec 11, 2007 8:38 AM, Anders Norrbring [EMAIL PROTECTED] wrote: I'm looking at a situation I haven't run into before, and I'm a bit puzzled by it. I have this table structure: Table USERS: userid, class Table OBJECT: userid, class, result

Re: Query help, please..

2007-12-11 Thread Peter Brawley
Anders, I also want to find out the user's position relative to others depending on the result. For a given pUserID, something like this? SELECT userid,result,rank FROM ( SELECT o1.userid,o1.result,COUNT(o2.result) AS rank FROM object o1 JOIN object o2 ON o1.result o2.result OR

Re: Query question.

2007-10-31 Thread Joerg Bruehe
Hi Richard, Richard Reina wrote: I have a database table paycheck like this. empno, date, gross, fed_with 1234 2007-09-01 1153.85 108.26 1323 2007-09-01 461.54 83.08 1289 2007-09-01 1153.85 94.41 1234 2007-09-15 1153.85 108.26 1323 2007-09-15 491.94 87.18 1289

Re: Query question.

2007-10-31 Thread Adrian Bruce
you need to group the result sets by date, look at the manual link below: http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html Richard Reina wrote: I have a database table paycheck like this. empno, date, gross, fed_with 1234 2007-09-01 1153.85 108.26 1323 2007-09-01

Re: query question

2007-10-31 Thread Adrian Bruce
[mailto:[EMAIL PROTECTED] Sent: Tuesday, October 30, 2007 1:55 AM To: Andrey Dmitriev Cc: mysql@lists.mysql.com Subject: Re: query question Thanks.. It doesn't seem to work though.. I did verify I am on 5.0 Try lose the space after group_concat. PB Andrey Dmitriev wrote: Thanks

RE: query question

2007-10-30 Thread Andrey Dmitriev
I knew I’ve seen this error before ☺ Thanks a lot. -andrey From: Peter Brawley [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 30, 2007 1:55 AM To: Andrey Dmitriev Cc: mysql@lists.mysql.com Subject: Re: query question Thanks.. It doesn't seem to work

Re: query question

2007-10-29 Thread Baron Schwartz
Hi, Andrey Dmitriev wrote: This is kind of achievable in Oracle in either sqlplus mode, or with the use of analytical functions. Or in the worst case by writing a function. But basically I have a few tables Services, Hosts, service_names And I can have a query something like select

RE: query question

2007-10-29 Thread Andrey Dmitriev
To: Andrey Dmitriev Cc: mysql@lists.mysql.com Subject: Re: query question Hi, Andrey Dmitriev wrote: This is kind of achievable in Oracle in either sqlplus mode, or with the use of analytical functions. Or in the worst case by writing a function. But basically I have a few tables Services

Re: query question

2007-10-29 Thread Peter Brawley
mysql.group_concat does not exist -Original Message- From: Baron Schwartz [mailto:[EMAIL PROTECTED] Sent: Monday, October 29, 2007 4:00 PM To: Andrey Dmitriev Cc: mysql@lists.mysql.com Subject: Re: query question Hi, Andrey Dmitriev wrote: This is kind of achievable in Oracle in either

Re: Query performance plain/text versus AES_DECRYPT(): LIKE %..%

2007-10-25 Thread John Kraal
Auch, thanks for pointing that out, what a terrible mistake. I am aware of the performance issue, and so is the customer. But with a table that's only going to hold maximally 60.000 records in 10 years, I'm not afraid it'll cause significant problems. If it gets out of hand we'll have to

Re: Query performance plain/text versus AES_DECRYPT(): LIKE %..%

2007-10-24 Thread John Kraal
I put it here: http://pro.datisstom.nl/tests/bench.tar.bz2 The encryption isn't really a *real* security measure, except for when somebody is stupid enough to install phpMyAdmin or anything equivalent and try to get personal data. The problem is the password needs to be anywhere on the

Re: Query performance plain/text versus AES_DECRYPT(): LIKE %..%

2007-10-24 Thread Jeremy Cole
Hi John, OK, no conspiracy here. Here is your problem: 25 $qry = sprintf(SELECT id, line FROM `encryptietest` WHERE AES_DECRYPT(`field`, '%') LIKE '%%%s%%', $enckey, $word); You are missing the s in %s for your first string argument, which causes the query to be syntactically

RE: Query performance plain/text versus AES_DECRYPT(): LIKE %..%

2007-10-23 Thread Jerry Schwartz
Have you tried reversing the order of your tests, to see if there is some influence from caching? Regards, Jerry Schwartz The Infoshop by Global Information Incorporated 195 Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 www.the-infoshop.com www.giiexpress.com

Re: Query performance plain/text versus AES_DECRYPT(): LIKE %..%

2007-10-23 Thread John Kraal
Yes, I did, and shutdowns between the tests and between reversing the tests. -- / Humanique / Webstrategie en ontwikkeling / http://www.humanique.com/ - Humanique zoekt een ervaren Web-ontwikkelaar (PHP). Bekijk de vacature op http://www.humanique.com/ - Jerry Schwartz wrote: Have you tried

Re: Query performance plain/text versus AES_DECRYPT(): LIKE %..%

2007-10-23 Thread Jeremy Cole
Hi John, Your attachment for the php code got stripped somewhere. Can you post it somewhere (http preferable)? In either case it's going to result in a full table scan, so they are actually both a bad strategy long term, but they should in theory perform as you would expect, with with

Re: Query not returning Data

2007-10-13 Thread Brent Baisley
That is a string comparison, so they will never be equal. You don't have to put quotes around field names unless you are using reserved words, which you shouldn't. If you do use quotes around field names, you need to use `backticks`. On Oct 10, 2007, at 1:15 PM, Martijn Tonies wrote:

Re: Query not returning Data

2007-10-10 Thread russbucket
russbucket wrote: I have the following query: SELECT * FROM Sight_Hearing_Help WHERE 'type_help' = Eye Exam Glasses AND 'board_action_date' BETWEEN 07-01-2007 AND 12-31-2007 LIMIT 0 , 60; Returns empty row every time. The board_action_date is a varchar field. Not a date field. I have

RE: Query not returning Data

2007-10-10 Thread Jay Blanchard
[snip] SELECT * FROM Sight_Hearing_Help WHERE 'type_help' = Eye Exam Glasses AND 'board_action_date' BETWEEN 07-01-2007 AND 12-31-2007 LIMIT 0 , 60; [/snip] Try WHERE type_help LIKE '%Eye Exam Glasses%' and look at your dates in the database themselves even if they are varchars, they are

RE: Query not returning Data

2007-10-10 Thread Little, Timothy
Oh boy.. having the date stored as a varchar in that particular format will be profoundly problematic. You might want to store it -MM-DD or the SQL BETWEEN will mangle the expected return results. Does it work (return a non-empty result-set) when you omit the LIMIT clause? Does it work

RE: Query not returning Data

2007-10-10 Thread Jerry Schwartz
Have you tried testing the two parts of your WHERE clause separately? Regards, Jerry Schwartz The Infoshop by Global Information Incorporated 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

Re: Query not returning Data

2007-10-10 Thread Stut
russbucket wrote: Sorry about double post, I am having problems with my ISP. I have the following query: SELECT * FROM Sight_Hearing_Help WHERE 'type_help' = Eye Exam Glasses AND 'board_action_date' BETWEEN 07-01-2007 AND 12-31-2007 LIMIT 0 , 60; Returns empty row every time. The

Re: Query not returning Data

2007-10-10 Thread Martijn Tonies
Sorry about double post, I am having problems with my ISP. I have the following query: SELECT * FROM Sight_Hearing_Help WHERE 'type_help' = Eye Exam Glasses AND 'board_action_date' BETWEEN 07-01-2007 AND 12-31-2007 LIMIT 0 , 60; Returns empty row every time. The board_action_date is

Re: query kills mysqld

2007-09-22 Thread Shawn Green
Will Nordin wrote: MySQL Ver 8.41 Distrib 5.0.27 Intel Xeon 3.60 GHz 2.0 G of RAM Windows Server 2003 Service Pack 1 The following query will sometimes work and sometimes fail. When it fails it kills the mysqld service and requires it to be restarted. Sometimes if I add additional

Re: Query to find foo within (foo)

2007-09-21 Thread thomas Armstrong
Finally I decided to use: -- SELECT id FROM mytable WHERE MATCH(firstname, lastname, comments) AGAINST ('+johnie' IN BOOLEAN MODE) ORDER BY firstname, lastname It works (except with acute vowel words in UTF8). Thank you very much. On 9/20/07, Baron Schwartz [EMAIL PROTECTED] wrote:

Re: Query to find foo within (foo)

2007-09-20 Thread thomas Armstrong
Thank you Michael for your answer. On 9/19/07, Michael Dykman [EMAIL PROTECTED] wrote: The whitespace counts... try LIKE '%johnie%' (or better '_johnie_' .. the underscorematches any single character). I want to match '(johnie)' and not 'johnies' or 'aljohnier', what it's the query does with

Re: Query to find foo within (foo)

2007-09-20 Thread thomas Armstrong
Thank you Chris for your answer. On 9/19/07, Chris Sansom [EMAIL PROTECTED] wrote: Well I'm hardly the world's greatest expert, but I'm curious as to why you're always separating '%' from 'johnie' with a space, because that way it will only find Johnie if he has a space before or after him

Re: Query to find foo within (foo)

2007-09-20 Thread thomas Armstrong
If you need something more complicated, such as only ignoring (, then you need to get more complicated. You might even need a regular expression. I'm to browse: http://dev.mysql.com/doc/refman/5.0/en/regexp.html http://www.wellho.net/regex/mysql.html Thank you very much! Regards, Jerry

Re: Query to find foo within (foo)

2007-09-20 Thread Baron Schwartz
thomas Armstrong wrote: If you need something more complicated, such as only ignoring (, then you need to get more complicated. You might even need a regular expression. I'm to browse: http://dev.mysql.com/doc/refman/5.0/en/regexp.html http://www.wellho.net/regex/mysql.html You know, you

RE: Query to find foo within (foo)

2007-09-20 Thread Jerry Schwartz
: 860.674.8341 www.the-infoshop.com www.giiexpress.com www.etudes-marche.com -Original Message- From: thomas Armstrong [mailto:[EMAIL PROTECTED] Sent: Thursday, September 20, 2007 3:52 AM To: Michael Dykman Cc: mysql@lists.mysql.com Subject: Re: Query to find foo within (foo) Thank you Michael

RE: Query to find less than 3 char string

2007-09-20 Thread Jerry Schwartz
20, 2007 1:28 PM To: 'thomas Armstrong'; 'Michael Dykman' Cc: mysql@lists.mysql.com Subject: RE: Query to find foo within (foo) If you want to match only (johnie) or johnie , then you could use a regular expression test. They can get as complicated as your brain will tolerate. Regards

Re: Query to find foo within (foo)

2007-09-19 Thread Chris Sansom
At 19:34 +0200 19/9/07, thomas Armstrong wrote: I've got this table in mySQL: item 1: -- firstname: John (Johnie) -- phone: 555-600-200 item 2: -- firstname: Peter -- phone: 555-300-400 I created this SQL query to find 'johnie': SELECT friends.id FROM friends WHERE

RE: Query to find foo within (foo)

2007-09-19 Thread Jerry Schwartz
You are putting a space between johnie and the % wildcards. That space is not ignored, it is part of the pattern. LIKE %johnie% will find every occurrence of johnie no matter what surrounds it. If you need something more complicated, such as only ignoring (, then you need to get more complicated.

Re: query using connected username

2007-09-14 Thread Baron Schwartz
Peter Teunissen wrote: Hi All, I'd like to restrict queries using the username of the user that issued the query. I know about the available user restrictions in the database, but they seem limited to whole tables and columns. What I need is limiting the access on row level. If I can access

Re: Query sloooow

2007-08-27 Thread Dan Buettner
Hi Jim - I'm using MySQL on Fedora 6 as well, with no performance problems. Did not need to do anything to speed it up on Fedora. It's difficult to answer the question why one is faster than the other, as there are any number of potential differences. Some more specifics about your setup

Re: Query error

2007-08-22 Thread Gerard van Beek
The comma at the end of the SELECT statement needs to be removed Naz Gassiep wrote: Hi, I'm trying to execute this query: SELECT group_post.group_thread_id, FROM group_post LEFT OUTER JOIN group_post_moderation ON (group_post.group_post_id =

Re: Query cache problem with stored procedures

2007-08-19 Thread Baron Schwartz
Hi, Your questions are answered in the manual: http://dev.mysql.com/doc/refman/5.0/en/query-cache-how.html It is a known limitation. Edoardo Serra wrote: Hi all, I'm benchmarking performance improvement with MySQL Query Cache turned on but I'm facing some problem with queries inside

Re: Query Problems

2007-07-19 Thread Douglas Araujo
We solved it here, There was a problem in the query, we removed the t1 at the 'group by' section. The problem was really a sintax error in the code not in the server. Thanks, Douglas 2007/7/19, Michael Dykman [EMAIL PROTECTED]: instead of leaving it in PHP, please print out your fully

Re: Query against two data types

2007-07-12 Thread Baron Schwartz
Hi, If at all possible, normalizing the data is far and away the best solution. Failing that, you can use regular expressions RLIKE REPLACE(col, ' ', '|') or INSTR(). Another solution is fulltext search, but it would have many limitations depending on what you really need to do.

RE: Query against two data types

2007-07-12 Thread Weston, Craig (OFT)
: mysql@lists.mysql.com Subject: Re: Query against two data types Hi, If at all possible, normalizing the data is far and away the best solution. Failing that, you can use regular expressions RLIKE REPLACE(col, ' ', '|') or INSTR(). Another solution is fulltext search, but it would have

Re: Query cache question when using HANDLER

2007-06-27 Thread Jim Winstead
On Wed, Jun 27, 2007 at 01:27:24PM +1200, Ian Collins wrote: Are HANDLER queries cached in the query cache? No, they are not. The query cache only caches the results of SELECT statements. Jim Winstead MySQL Inc. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To

Re: Query seemingly ignoring order by after upgrade

2007-06-22 Thread Dan Buettner
You may have encountered a bug; one thing you could do to avoid having to downgrade is specify the column number you wish to sort on (4th column in your case), as in: ORDER BY 4 DESC LIMIT 10; Dan On 6/22/07, Andrew Carlson [EMAIL PROTECTED] wrote: I upgraded to Mysql 5.0.42 from 4.1.14

Re: Query Cache Behavior

2007-05-11 Thread Baron Schwartz
Hi, Paul J. Boyes wrote: Hello, I am hoping to get pointed in the right direction/save some time... I have a db in which some web services are constantly inserting/updating data. However, when I run selects from the command line mysql app, I do not see the changes that these services have

Re: Query Cache Behavior

2007-05-11 Thread Paul J. Boyes
This is our problem: http://bugs.mysql.com/bug.php?id=27210 Thanks, Paul Baron Schwartz wrote: Hi, Paul J. Boyes wrote: Hello, I am hoping to get pointed in the right direction/save some time... I have a db in which some web services are constantly inserting/updating data. However,

Re: Query problem

2007-05-09 Thread Martijn Tonies
I have a table of properties that is linked to a table f images with a one property to many images relationship. I have manged this with nested queries but want to try and do it on one line. My current query $query = SELECT * FROM images, properties WHERE images.property_id =

Re: Query problem

2007-05-09 Thread Jon Ribbens
On Wed, May 09, 2007 at 07:14:38PM +0200, Martijn Tonies wrote: I have a table of properties that is linked to a table f images with a one property to many images relationship. I have manged this with nested queries but want to try and do it on one line. My current query $query = SELECT *

Re: Query problem

2007-05-09 Thread ross
No I want all the properties only one regardless of how many images are attached to them. Think I need a distinct in there somewhere, - Original Message - From: Jon Ribbens [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Wednesday, May 09, 2007 6:56 PM Subject: Re: Query problem

Re: Query problem

2007-05-09 Thread Martijn Tonies
how do I return a single row per property even if it has 3 or 4 images attached to it. Please reply to the list instead of directly to me. You could do a: select p.from properties p where exists (select i.* from images i where i.property_id = p.property_id) I have a table of properties

Re: Query question

2007-04-24 Thread Anoop kumar V
Can you post your table definitions and some sample data. Also what is the end requirement - how should the end result look like? Anoop On 4/23/07, Clyde Lewis [EMAIL PROTECTED] wrote: Guys, I have the following table that contains some information about a cars. I'm trying to write a query

Re: Query Pls

2007-04-17 Thread Ananda Kumar
Hi Renish, What is the query that you ran, please let us know. regards anandkl On 4/17/07, Renish koshy [EMAIL PROTECTED] wrote: I had a trial version of Navicat 7.2 in my system. Now I installed the full version 7.0.9 enterprise Navicat. After that when I run the existing query,,I get a n

Re: Query Pls

2007-04-17 Thread Renish koshy
I guess it is nothing to do with the query as it was working perfectly fine be4 installing the Navicat enterprise version 7.0.9 .thanks a lot On 4/17/07, Ananda Kumar [EMAIL PROTECTED] wrote: Hi Renish, What is the query that you ran, please let us know. regards anandkl

Re: Query Pls

2007-04-17 Thread Martijn Tonies
I guess it is nothing to do with the query as it was working perfectly fine be4 installing the Navicat enterprise version 7.0.9 .thanks a lot Why don't you install 7.2 full version? Why did you go back a few versions? Martijn Tonies Database Workbench - development tool for MySQL, and

Re: Query Question

2007-04-16 Thread Baron Schwartz
Hi Aaron, Aaron Clausen wrote: I have a couple of very simple tables to handle a client signin site: The client table has the following fields: client_id int(11) primary key auto_increment first_name char(90) last_name char(90) The signin table has the following fields record_id int

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