Re: how to query this

2009-09-10 Thread Claudio Nanni
This can also help: select id,value from table order by value desc limit 1; Cheers Claudio 2009/9/10 Slackli User > Thanks all the info. > Just got what I wanted. > > 2009/9/10 Wolfgang Schaefer : > > John Daisley schrieb: > >> SELECT MAX(value), id FROM table > >> GROUP BY id; > >> > >> >

Re: how to query this

2009-09-10 Thread Slackli User
Thanks all the info. Just got what I wanted. 2009/9/10 Wolfgang Schaefer : > John Daisley schrieb: >> SELECT MAX(value), id FROM table >> GROUP BY id; >> >> >> > > I guess what Slackli had in mind was more something like this: > SELECT id, value > FROM table > WHERE value = (SELECT max(value) FROM

Re: how to query this

2009-09-10 Thread Wolfgang Schaefer
John Daisley schrieb: > SELECT MAX(value), id FROM table > GROUP BY id; > > Regards > > John Daisley > Mobile +44(0)7812 451238 > Email j...@butterflysystems.co.uk > > Certified MySQL 5 Database Administrator (CMDBA) > Certified MySQL 5 Developer > Cognos BI Developer > > --- >

RE: how to query this

2009-09-10 Thread John Daisley
SELECT MAX(value), id FROM table GROUP BY id; Regards John Daisley Mobile +44(0)7812 451238 Email j...@butterflysystems.co.uk Certified MySQL 5 Database Administrator (CMDBA) Certified MySQL 5 Developer Cognos BI Developer --- Sent from HP IPAQ mobile device. -Origina

Re: How to Query by First Part of a VARCHAR?

2007-07-04 Thread gary
the thing to remember is that if you only want strings that start with CAT you'd never want to query with %CAT% because this could match DOG_CATHY. % is a wildcard that matches any number of characters including none. if you want to match a single character you use _ if you actually need to s

Re: How to Query by First Part of a VARCHAR?

2007-07-04 Thread David T. Ashley
On 7/4/07, Dan Nelson <[EMAIL PROTECTED]> wrote: In the last episode (Jul 04), David T. Ashley said: > On 7/4/07, gary <[EMAIL PROTECTED]> wrote: > > SELECT column FROM table WHERE column LIKE "CAT\_%"; > > Would it be reasonable to assume that if "column" is indexed, the > query would execut

Re: How to Query by First Part of a VARCHAR?

2007-07-04 Thread Dan Nelson
In the last episode (Jul 04), David T. Ashley said: > On 7/4/07, gary <[EMAIL PROTECTED]> wrote: > > SELECT column FROM table WHERE column LIKE "CAT\_%"; > > Would it be reasonable to assume that if "column" is indexed, the > query would execute quickly, i.e. I would assume that the indexing >

Re: How to Query by First Part of a VARCHAR?

2007-07-04 Thread David T. Ashley
On 7/4/07, gary <[EMAIL PROTECTED]> wrote: SELECT column FROM table WHERE column LIKE "CAT\_%"; Would it be reasonable to assume that if "column" is indexed, the query would execute quickly, i.e. I would assume that the indexing would facilitate this kind of query?

Re: How to Query by First Part of a VARCHAR?

2007-07-04 Thread gary
SELECT column FROM table WHERE column LIKE "CAT\_%"; -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: how to query this sql?

2007-04-28 Thread Mogens Melander
On Sun, April 29, 2007 05:28, Jeff Pang wrote: > Hello list, > > I want to get the counter for db-items by each day,so I wrote this sql: > > select count(*) as dd from items group by updatetime; > > But sorry "updatetime" is "datetime" type,not "date" type.Then I can't get > the correct result. >

Re: Re: How to query bind address?

2006-08-23 Thread James Eaton
; Cc: Sent: Wednesday, August 23, 2006 3:07 PM Subject: Re: Re: How to query bind address? Is it running on Windows, James? You may have to allow connections through to MySQL in Windows Firewall. Otherwise it seems like maybe it's been started with --skip-networking ? Dan On 8/23/06, Ja

Re: Re: How to query bind address?

2006-08-23 Thread Dan Buettner
Is it running on Windows, James? You may have to allow connections through to MySQL in Windows Firewall. Otherwise it seems like maybe it's been started with --skip-networking ? Dan On 8/23/06, James Eaton <[EMAIL PROTECTED]> wrote: - Original Message - From: "Dan Buettner" <[EMAIL P

Re: How to query bind address?

2006-08-23 Thread James Eaton
- Original Message - From: "Dan Buettner" <[EMAIL PROTECTED]> I believe MySQL listens on all IPs ... what if any error message are you getting? From SQLyog I get: Error No. 2003 Can't connect to MySQL server on '192.168.9.2' (10061) Can you access other services (SSH, telnet,

Re: How to query bind address?

2006-08-23 Thread Dan Buettner
I believe MySQL listens on all IPs ... what if any error message are you getting? Can you access other services (SSH, telnet, FTP) over the same routes? Can you telnet to MySQL over those routes? If so you may have an authentication problem, not a connection problem. Here's a sample of what a

Re: How to query on part of a date column?

2006-07-20 Thread mos
At 06:20 PM 7/20/2006, Martin Jespersen wrote: As long as backticks are used around fieldnames, spaces and/or reserved words are fine, tho it does tend to create more work for the user ;) Correct. But how many people want to create more work for themselves? A show of hands please! Mike mo

Re: How to query on part of a date column?

2006-07-20 Thread Martin Jespersen
As long as backticks are used around fieldnames, spaces and/or reserved words are fine, tho it does tend to create more work for the user ;) mos wrote: At 12:02 PM 7/20/2006, you wrote: I've got a table of people who registered for a convention. Each person has a registration date, kept in a

Re: How to query on part of a date column?

2006-07-20 Thread mos
At 12:02 PM 7/20/2006, you wrote: I've got a table of people who registered for a convention. Each person has a registration date, kept in a standard date field. How do I select for people who registered in a particular month or year? The obvious tests like: Select * from Capclave2005reg W

Re: How to query on part of a date column?

2006-07-20 Thread Dan Buettner
Barry, I think you've got too many quotes in your SQL - the db is trying to find the year from the string 'date paid'. You want to use it as a column name, so drop the quotes: Select * from Capclave2005reg Where Year(Date Paid) = 2004; If you've really got a space in your column name, try enclo

"high priority" messages (Re: How to query an oracle table from a mysql database)

2004-07-07 Thread Martijn Tonies
Hi all, Please, do NOT send messages to a public mailinglist as "high priority" by flagging the email itself. You're sending this message to hundreds/thousands of people. It might be "important" to you, but not for each recipient. If someone has filters/triggers for "important" email, he will get

RE: How to query an oracle table from a mysql database

2004-07-07 Thread Alonso, Claudio Fabian
e 2004 15:46 Para: 'Alonso, Claudio Fabian '; ''Steve Davies' ' CC: '''[EMAIL PROTECTED]' ' ' Asunto: RE: How to query an oracle table from a mysql database A custom MySQL UDF is one solution if you are comfortable with C. Off list questi

RE: How to query an oracle table from a mysql database

2004-07-07 Thread Victor Pendleton
Sent: 7/7/04 11:18 AM Subject: RE: How to query an oracle table from a mysql database Importance: High Hello Steve, hello Victor, Thanks for your answers. My PHP application needs to see this Oracle table, but as far as I could see PHP has problems with Oracle 9.2.0. I got a conection problem and f

RE: How to query an oracle table from a mysql database

2004-07-07 Thread Paul DuBois
At 13:18 -0300 7/7/04, Alonso, Claudio Fabian wrote: Hello Steve, hello Victor, Thanks for your answers. My PHP application needs to see this Oracle table, but as far as I could see PHP has problems with Oracle 9.2.0. I got a conection problem and found in the PHP's bug database that it isn't curre

RE: How to query an oracle table from a mysql database

2004-07-07 Thread Justin Swanhart
No, that isn't possible using mySQL. Try linking PHP with older client libraries (9.0.1, 8.1.5, etc) instead of the newer 9.2 libraries and see if that fixes your problem with PHP. You can download them from otn.oracle.com swany --- "Alonso, Claudio Fabian" <[EMAIL PROTECTED]> wrote: > Hello S

RE: How to query an oracle table from a mysql database

2004-07-07 Thread Alonso, Claudio Fabian
Hello Steve, hello Victor, Thanks for your answers. My PHP application needs to see this Oracle table, but as far as I could see PHP has problems with Oracle 9.2.0. I got a conection problem and found in the PHP's bug database that it isn't currently working. As I'm familiar with PHP/MySQL, I'm try

Re: How to query an oracle table from a mysql database

2004-07-07 Thread Martin Gainty
abian '" <[EMAIL PROTECTED]> CC: "''[EMAIL PROTECTED]' '" <[EMAIL PROTECTED]> Subject: Re: How to query an oracle table from a mysql database Date: Wed, 07 Jul 2004 17:02:59 +0100 MIME-Version: 1.0 Received: from lists.mysql.com ([213.136.52.31]) b

Re: How to query an oracle table from a mysql database

2004-07-07 Thread Steve Davies
Try PHP, it has built in functions to access both DBs HTH Steve Victor Pendleton wrote: You may want to look into using a programming language such as C or Java that communicates between both databases. -Original Message- From: Alonso, Claudio Fabian To: '[EMAIL PROTECTED]' Sent: 7/7/04 8

RE: How to query an oracle table from a mysql database

2004-07-07 Thread Victor Pendleton
You may want to look into using a programming language such as C or Java that communicates between both databases. -Original Message- From: Alonso, Claudio Fabian To: '[EMAIL PROTECTED]' Sent: 7/7/04 8:14 AM Subject: How to query an oracle table from a mysql database Importance: High Goo

Re: How to query

2003-12-04 Thread Randy Chrismon
I'm stumped... Now, I need to generate reports for a specific client. In the end, for a given month, I have to tell the client 1. Which invoices were for the purchase of blue widgets, only. 2. Which invoices were for the purchase of blue widgets and yellow widgets, together. 3. Which invoices for

Re: How to query mySQL in java without using actual column names? but using something like field(0),field(1) etc.,

2003-11-08 Thread Paul DuBois
At 10:38 -0500 11/8/03, karthikeyan wrote: I have a table with about 100 column with different column name. It is difficult to remember all the field names. But I know the last few columns are very important for query and used frequently. You cannot perform comparisons on columns by using column po

Re: How to query for 25 records before and 25 records after a record alphabetically

2003-11-03 Thread gerald_clark
ORDER BY and LIMIT. Jeremy March wrote: I have an alphabetic list of records in a table and I want to display the 25 previous and 25 next records before and after a selected record. This would be easy if "before" and "after" meant sorted by id number, but I need it sorted alphabetically. Doe

Re: Re: How to query an entire row?

2003-02-24 Thread Jeff Snoxell
At 13:53 24/02/03 +0100, you wrote: Hello. On Mon 2003-02-24 at 11:28:05 +, [EMAIL PROTECTED] wrote: > Hello, > > In a table like this: > > ID > Item1 char(100) > Item2 char(100) > . > . > ItemN char(100) > > What's the cleanest way to do this mysql query: > > SELECT * FROM MyTable WHERE AnyCo

Re: How to query an entire row?

2003-02-24 Thread Benjamin Pflugmann
Hello. On Mon 2003-02-24 at 11:28:05 +, [EMAIL PROTECTED] wrote: > Hello, > > In a table like this: > > ID > Item1 char(100) > Item2 char(100) > . > . > ItemN char(100) > > What's the cleanest way to do this mysql query: > > SELECT * FROM MyTable WHERE AnyColumn LIKE '%mysearch%' > > Only

Re: --- How to query results of a query?

2003-01-16 Thread harm
On Wed, Jan 15, 2003 at 11:55:44PM +, [EMAIL PROTECTED] wrote: > > please look at page 194 of the reference manual... > > >(and if so how do you ask MySQL to create a temp table from the > > results of aquery?) > > here's an example: > > mysql> create temporary table tmp (name varchar(20),

Re:--- How to query results of a query?

2003-01-15 Thread nossareh
please look at page 194 of the reference manual... >(and if so how do you ask MySQL to create a temp table from the > results of aquery?) here's an example: mysql> create temporary table tmp (name varchar(20), owner varchar(20, species varchar(10)); mysql> insert into tmp select name, owner,

Re: --- How to query results of a query?

2003-01-15 Thread Benjamin Pflugmann
Hello. Please start a new thread instead of replying to an existing one. Or else, your message will be sorted with the original thread for people with decent mail readers. On Wed 2003-01-15 at 14:42:05 -0500, [EMAIL PROTECTED] wrote: > How do you query the table that is the results of a query? B

Re: --- How to query results of a query?

2003-01-15 Thread greg55
If you're in Java you can call getMetaData on the ResultSet, and then call methods on that (ResultSetMetaData) to determine number of columns, and type of each column. This avoids the steps of creating/deleting a temp table. What language are you using? > > From: Will Standley <[EMAIL PROTECT

Re: How to query a varchar column's value staring with a string?

2002-10-31 Thread Andre Kirchner
Hi there, I found a way to do it with the following query select * from theTable where 'test' like concat( theColumn, '%' ); Thanks for the help, Andre --- Andre Kirchner <[EMAIL PROTECTED]> wrote: > thanks for the help, but what I really want is to > select all the values that are a substrin

Re: How to query a varchar column's value staring with a string?

2002-10-31 Thread Andre Kirchner
thanks for the help, but what I really want is to select all the values that are a substring of 'test' as 't', 'te', 'tes' and 'test', and so I was trying the query select * from theTable where ( theColumn || '%' ) like 'test'; I think my previous email as a litle bit confusing. Sorry for that :

Re: how to query for the primary key?

2002-06-14 Thread Egor Egorov
justin, Friday, June 14, 2002, 4:52:12 AM, you wrote: jc> This seems like a dumb question--sorry. Looking at my table it shows jc> 'MUL' instead of 'PRI' like the other tables. Did I forget to code jc> unit_id as primary? Thanks, Justin jc> mysql> desc property_units; jc> ++--

Re: how to query for the primary key?

2002-06-14 Thread Aleksandar Bradaric
Hi, > This seems like a dumb question--sorry. Looking at my table it shows > 'MUL' instead of 'PRI' like the other tables. Did I forget to code > unit_id as primary? Thanks, Justin mysql> show index from property_units; Regards, Sasa »mysql, select, database« ---

Re: How to query SET OPTION variables?

2002-05-03 Thread Jeremy Zawodny
On Fri, May 03, 2002 at 01:22:30PM +0200, Harald Fuchs wrote: > > How about "SHOW OPTIONS [LIKE wild]", nicely accompanying "SHOW VARIABLES"? Yeah, that'd be the way to go, I think. -- Jeremy D. Zawodny, <[EMAIL PROTECTED]> Technical Yahoo - Yahoo Finance Desk: (408) 349-7878 Fax: (408) 349-54

Re: How to query SET OPTION variables?

2002-05-02 Thread Benjamin Pflugmann
Hi. On Thu, May 02, 2002 at 12:02:44AM -0700, [EMAIL PROTECTED] wrote: > On Tue, Apr 30, 2002 at 04:17:00PM +0200, Benjamin Pflugmann wrote: > > Hi. > > > > Maybe I am blind, but I cannot find, how I can query the status of > > one of the variables I can set with SET OPTION. I.e. if I do > > >

RE: How to query and return nearest value...

2001-01-24 Thread Patrick FICHE
Try something like this SELECT price, min(abs(price-value)) as Mini from table group by price order by Mini LIMIT 1 Patrick -Message d'origine- De : Robert Badaracco [mailto:[EMAIL PROTECTED]] Envoyé : mercredi 24 janvier 2001 05:47 À : [EMAIL PROTECTED] Objet : How to query and return