Re: Help with a query

2011-05-20 Thread Aveek Misra
ERE tmp.file = C.file and tmp.digest = C.digest); --Anupam --- On Tue, 17/5/11, Aveek Misra mailto:ave...@yahoo-inc.com>> wrote: From: Aveek Misra mailto:ave...@yahoo-inc.com>> Subject: Help with a query To: "mysql@lists.mysql.com<mailto:mysql@lists.mysql.com>" mailto:m

Re: Help with a query

2011-05-20 Thread Anupam Karmarkar
, digest HAVING Sum(Cnt) <> (Select sum(refcount) from C WHERE tmp.file = C.file and tmp.digest = C.digest); --Anupam --- On Tue, 17/5/11, Aveek Misra wrote: From: Aveek Misra Subject: Help with a query To: "mysql@lists.mysql.com" Date: Tuesday, 17 May, 2011, 1:23 PM I ha

Help with a query

2011-05-17 Thread Aveek Misra
I have a table A and table B of the same type as CREATE TABLE A ( `file` varbinary(255) not null, `digest` binary(40) not null ) CREATE TABLE B ( `file` varbinary(255) not null, `digest` binary(40) not null ) I have another table C of the following type CREATE TABLE C (

Re: Help with a query.

2009-01-27 Thread Micah Stevens
Peter Brawley wrote: Micah, >each item in `a` has a 1 to 1 relationship to `b`, >and each item in `c` has a 1 to 1 relationship with `b`. >Sometimes these correspond, i.e. there's a row in `b` >that relates to both `a` and `c`, but not always. So in a given b row, the b_id value might match an

Re: Help with a query.

2009-01-27 Thread Peter Brawley
Micah, >each item in `a` has a 1 to 1 relationship to `b`, >and each item in `c` has a 1 to 1 relationship with `b`. >Sometimes these correspond, i.e. there's a row in `b` >that relates to both `a` and `c`, but not always. So in a given b row, the b_id value might match an a.a_id, a c.a_id, or

Help with a query.

2009-01-27 Thread Micah Stevens
Hi, I'm somewhat stumped by how to set up a single query that does the following. Currently I'm accomplishing this through multiple queries and some PHP 'glue' logic, but it should be possible in a single query I think, and it's bugging me that I can't figure it out. If anyone has any ideas,

help with a query...

2007-12-28 Thread Richard
Hello, I'm trying to get what is for me quite a complicated query to work, if it's possible to do so anyway ... Here is my old query : SELECT a.message,a.date,b.surname,b.name,b.title FROM messages a JOIN info b ON a.from=b.code WHERE a.id='28' It worked fine untill I needed to have more than on

Re: Need help with a query

2006-01-23 Thread Mark Phillips
On Monday 23 January 2006 03:33 pm, Michael Stassen wrote: > Mark Phillips wrote: > > I am running mysql 4.0.24 on Debian sarge. > > > > I have a table with two columns, "team" and "division", both varchar(255). > > There are some errors in the table where division has a value but team is > > bl

Re: Need help with a query

2006-01-23 Thread Michael Stassen
Mark Phillips wrote: I am running mysql 4.0.24 on Debian sarge. I have a table with two columns, "team" and "division", both varchar(255). There are some errors in the table where division has a value but team is blank. Given that I am getting new data, and the data entry folks may create a r

Need help with a query

2006-01-23 Thread Mark Phillips
I am running mysql 4.0.24 on Debian sarge. I have a table with two columns, "team" and "division", both varchar(255). There are some errors in the table where division has a value but team is blank. Given that I am getting new data, and the data entry folks may create a record with a blank divi

Re: Need Help with a query

2005-12-12 Thread Gleb Paharenko
Hello. You may use these queries: select flight_id ,baseline*tan(radians(angle)) as attitude from flights where (baseline*tan(radians(angle))) = ( select max(baseline*tan(radians(angle))) from flights f2); +---+-

Fwd: Re: Need Help with a query

2005-12-11 Thread Mark Phillips
I forgot to copy the list as well Mark -- Forwarded Message -- Subject: Re: Need Help with a query Date: Sunday 11 December 2005 06:47 pm From: Mark Phillips <[EMAIL PROTECTED]> To: "Rhino" <[EMAIL PROTECTED]> Rhino, My apologies for leaving out t

Fw: Need Help with a query

2005-12-11 Thread Rhino
Oops, I meant to copy the list on this reply so that others could benefit Rhino - Original Message - From: "Rhino" <[EMAIL PROTECTED]> To: "Mark Phillips" <[EMAIL PROTECTED]> Sent: Sunday, December 11, 2005 6:19 PM Subject: Re: Need Help with a

Need Help with a query

2005-12-11 Thread Mark Phillips
I have a table with several columns. The ones of interest are flight_id, angle, and baseline. I want to find the flight_ids for the flights with the maximum and minimum altitudes, where altitude=baseline*tan(radians(angle)). For example, Flights +++---+ |

Re: Need help with a query..

2005-06-16 Thread Frank Bax
At 03:09 AM 6/16/05, Cory Robin wrote: I need to speed up a search, big time. I have an application that searches for records on a date field. If it doesn't find an exact date match, it keeps searching adjacent days until it finds a certain amount of records. The problem now is, I'm using my

Fw: Need help with a query..

2005-06-16 Thread SGreen
(forwarded to the list - I am not the OP) - Forwarded by Shawn Green/Unimin on 06/16/2005 11:45 AM - James Black <[EMAIL PROTECTED]> wrote on 06/16/2005 11:44:36 AM: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > [EMAIL PROTECTED] wrote: > > [EMAIL PROTECTED] wrote on 06/16/2005 11:

Re: Need help with a query..

2005-06-16 Thread Alec . Cawley
[EMAIL PROTECTED] wrote on 16/06/2005 16:29:46: > > > [EMAIL PROTECTED] wrote on 06/16/2005 11:30:10 AM: > > > Cory Robin <[EMAIL PROTECTED]> wrote on 16/06/2005 08:09:22: > > > > I need to speed up a search, big time. > > > > > > I have an application that searches for records on a date field

Re: Need help with a query..

2005-06-16 Thread SGreen
[EMAIL PROTECTED] wrote on 06/16/2005 11:30:10 AM: > Cory Robin <[EMAIL PROTECTED]> wrote on 16/06/2005 08:09:22: > > I need to speed up a search, big time. > > > > I have an application that searches for records on a date field. If it > > doesn't find an exact date match, it keeps searching ad

Re: Need help with a query..

2005-06-16 Thread Alec . Cawley
Cory Robin <[EMAIL PROTECTED]> wrote on 16/06/2005 08:09:22: > I need to speed up a search, big time. > > I have an application that searches for records on a date field. If it > doesn't find an exact date match, it keeps searching adjacent days until it > finds a certain amount of records. >

Need help with a query..

2005-06-16 Thread Cory Robin
I need to speed up a search, big time. I have an application that searches for records on a date field. If it doesn't find an exact date match, it keeps searching adjacent days until it finds a certain amount of records. The problem now is, I'm using my application to loop through and run multip

Re: MySQL (SQL) Newbie.. Need help with a Query

2005-06-07 Thread mfatene
hi, that's the same. If you use between, mysql do the rest for you : mysql> explain SELECT * FROM passengers WHERE -> reservation_date_time >= '2005-01-01 12:10:00' -> AND reservation_date_time <= '2005-05-01 12:10:00'; ++-++---+---++

Re: MySQL (SQL) Newbie.. Need help with a Query

2005-06-06 Thread mfatene
resubmitted Selon [EMAIL PROTECTED]: > hi, > that's the same. If you use between, mysql do the rest for you : > > mysql> explain SELECT * FROM passengers WHERE > -> reservation_date_time >= '2005-01-01 12:10:00' > -> AND reservation_date_time <= '2005-05-01 12:10:00'; > ++-

Re: MySQL (SQL) Newbie.. Need help with a Query

2005-06-05 Thread Michael Stassen
Sebastian wrote: Cory Robin wrote: I'm trying to return all records between two dates.. The fields are datetime fields... Which is better? The following or using BETWEEN? (A little lost here) SELECT * FROM passengers WHERE reservation_date_time >= '2005-01-01 12:10:00' AND reservation_date

Re: MySQL (SQL) Newbie.. Need help with a Query

2005-06-05 Thread Sebastian
Cory Robin wrote: I'm trying to return all records between two dates.. The fields are datetime fields... Which is better? The following or using BETWEEN? (A little lost here) SELECT * FROM passengers WHERE reservation_date_time >= '2005-01-01 12:10:00' AND reservation_date_time <= '2005-05-0

MySQL (SQL) Newbie.. Need help with a Query

2005-06-05 Thread Cory Robin
I'm trying to return all records between two dates.. The fields are datetime fields... Which is better? The following or using BETWEEN? (A little lost here) SELECT * FROM passengers WHERE reservation_date_time >= '2005-01-01 12:10:00' AND reservation_date_time <= '2005-05-01 12:10:00'; -- M

Re: Help with a query please

2005-02-21 Thread Andreas Ahlenstorf
shaun thornburgh schrieb: > Thanks for your reply, I would like the query to retun one > instance of user 101 rather than 15! SELECT DISTINCT ... Regards, A. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED

Re: Help with a query please

2005-02-21 Thread mel list_php
from the first table From: "shaun thornburgh" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED], mysql@lists.mysql.com Subject: Re: Help with a query please Date: Mon, 21 Feb 2005 13:24:55 + From: "Rhino" <[EMAIL PROTECTED]> To: "shaun thornburgh" <[

Re: Help with a query please

2005-02-21 Thread shaun thornburgh
From: "Rhino" <[EMAIL PROTECTED]> To: "shaun thornburgh" <[EMAIL PROTECTED]>, Subject: Re: Help with a query please Date: Mon, 21 Feb 2005 08:22:29 -0500 - Original Message - From: "shaun thornburgh" <[EMAIL PROTECTED]> To: Sent: Monday

Re: Help with a query please

2005-02-21 Thread Rhino
- Original Message - From: "shaun thornburgh" <[EMAIL PROTECTED]> To: Sent: Monday, February 21, 2005 7:28 AM Subject: Help with a query please > Hi, > > I am having trouble with the following query: > > SELECT U.User_ID, > U.User_Firstname

Help with a query please

2005-02-21 Thread shaun thornburgh
Hi, I am having trouble with the following query: SELECT U.User_ID, U.User_Firstname, U.User_Lastname FROM Users U, Allocations A WHERE (U.User_ID = A.User_ID OR U.User_ID = 101) AND A.Project_ID = '12' AND ( U.User_Type = 'Staff' OR U.User_Type = 'Manager' OR U.User_Type = 'Administrator' ) ORDER

Re: Help with a query using multiple LEFT JOINS

2005-02-01 Thread Harald Fuchs
In article <[EMAIL PROTECTED]>, "Graham Cossey" <[EMAIL PROTECTED]> writes: > I'm hoping someone can help with a little problem I'm having with a query. > In the query below I wish to return as least one row per tbl1, however I am > only getting rows where there is at least an entry for tbl2 : >

RE: Help with a query using multiple LEFT JOINS

2005-02-01 Thread Graham Cossey
Tom Crimmins > Interface Specialist > Pottawattamie County, Iowa > > -Original Message- > From: Graham Cossey > Sent: Monday, January 31, 2005 5:48 PM > To: mysql@lists.mysql.com > Subject: Help with a query using multiple LEFT JOINS > > I'm hoping someone can he

RE: Help with a query using multiple LEFT JOINS

2005-01-31 Thread Tom Crimmins
want to do the same for tbl4 depending on the behavior you are looking for. --- Tom Crimmins Interface Specialist Pottawattamie County, Iowa -Original Message- From: Graham Cossey Sent: Monday, January 31, 2005 5:48 PM To: mysql@lists.mysql.com Subject: Help with a query using multiple

Help with a query using multiple LEFT JOINS

2005-01-31 Thread Graham Cossey
I'm hoping someone can help with a little problem I'm having with a query. In the query below I wish to return as least one row per tbl1, however I am only getting rows where there is at least an entry for tbl2 : SELECT ... FROM tbl1 as d LEFT JOIN tbl2 as r ON d.dcode=r.dcode LEFT JOIN tbl3 as

Re: need help with a query

2004-08-25 Thread Redmond Militante
dmond Militante [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 25, 2004 6:03 PM > To: [EMAIL PROTECTED] > Subject: need help with a query > > hi > > i need advice on a query i'm trying to do. i'm trying to find entries with > that are about to expire. entries

Re: need help with a query

2004-08-25 Thread Michael Stassen
David Perron wrote: Are you assuming that all months have 30 days? You can use the same syntax with INTERVAL 1 MONTH True. I would also format the date comparison to use the same precision that the DATE_ADD function outputs. Why would you do that? The date column contains a DATE. CURDATE() retur

Re: need help with a query

2004-08-25 Thread Michael Stassen
Redmond Militante wrote: hi i need advice on a query i'm trying to do. i'm trying to find entries with that are about to expire. entries expire if their date of submission is older than 60 days. i want to find all entries with a date of submission greater than 30 days, or those that are going to

RE: need help with a query

2004-08-25 Thread David Perron
) I might be off on the 1 MONTH part, but I think it's the right track. -Original Message- From: Redmond Militante [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 25, 2004 6:03 PM To: [EMAIL PROTECTED] Subject: need help with a query hi i need advice on a query i'm trying to

need help with a query

2004-08-25 Thread Redmond Militante
hi i need advice on a query i'm trying to do. i'm trying to find entries with that are about to expire. entries expire if their date of submission is older than 60 days. i want to find all entries with a date of submission greater than 30 days, or those that are going to expire within a mont

Re: need help with a query

2004-03-25 Thread Ligaya Turmelle
sounds like you need a join. Select * from Poll, poll_votes where (Poll.poll_id = poll_votes.poll_id) and (poll_votes.user_ID = WHATEVER); But I'm still a beginner so Respectfully, Ligaya Turmelle ""Anders Gjermshus"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi. > > I'm

need help with a query

2004-03-25 Thread Anders Gjermshus
Hi. I'm having trouble with a query. I'm wondering if it is possible at all. I'm making a poll for my webpage. I have two tables: Poll and poll_votes Table poll contains data about the poll Poll_Votes contains all the votes. What I want is to pull out data about the poll and if the user

Re: Help with a query

2004-02-24 Thread Hassan Schroeder
[EMAIL PROTECTED] wrote: I think you may have introduced the >From typo ! Try looking at a mailbox in a text editor -- you'll notice that the string 'From ' occuring at the beginning of a line is used as the message separator. Thus when that string occurs within a message body, it needs to be es

Re: Help with a query

2004-02-24 Thread Michael Stassen
9:44 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: Help with a query Quoting [EMAIL PROTECTED]: Sounds like you want to do: Select store_name, t1mgr.manager_name as 'type_1_manager', t2mgr.manager_name as 'type_2_manager' From (keystone_stores ks left join manage

RE: Help with a query

2004-02-24 Thread Ted . A . Gifford
: [EMAIL PROTECTED] Subject: RE: Help with a query Quoting [EMAIL PROTECTED]: > > Sounds like you want to do: > > Select store_name, t1mgr.manager_name as 'type_1_manager', > t2mgr.manager_name as 'type_2_manager' > >From (keystone_stores ks left join

RE: Help with a query

2004-02-24 Thread Gregory A. Swarthout
Quoting [EMAIL PROTECTED]: > > Sounds like you want to do: > > Select store_name, t1mgr.manager_name as 'type_1_manager', > t2mgr.manager_name as 'type_2_manager' > >From (keystone_stores ks left join managers t1mgr on ks.id = > t1mgr.store_id > and t1mgr.manager_type = 1) > Left join managers t2

RE: Help with a query

2004-02-24 Thread Ted . A . Gifford
d = t2mgr.store_id and t2mgr.manager_type = 2 Does that fit the bill? Ted Gifford -Original Message- From: Gregory A. Swarthout [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 24, 2004 9:09 AM To: [EMAIL PROTECTED] Subject: Help with a query Suppose I have two tables like

Help with a query

2004-02-24 Thread Gregory A. Swarthout
Suppose I have two tables like this: keystone_storesmanagers = id | store_nameid | manager_name | manager_type | store_id +--- +---+---

Re: Need help with a query

2003-12-28 Thread Roger Baklund
* Soheil Shaghaghi > Hello everyone, > I need help with MySQL coding in php please if anyone can help. I can try. :) > I have 3 tables: > -users, where the user info is stored. > -awards: contains the list of all the awards for each user > -award_types: contains different types of award > The tab

Need help with a query

2003-12-27 Thread Soheil Shaghaghi
Hello everyone, I need help with MySQL coding in php please if anyone can help. I have 3 tables: -users, where the user info is stored. -awards: contains the list of all the awards for each user -award_types: contains different types of award The tables are at the bottom of the page. What I need

Re: Need help with a query..

2003-12-22 Thread Roger Baklund
* Aleksandar Bradaric > >> select key, desc, value > >> from your_table t1 > >> where value = (select max(value) from your_table where desc = t1.desc) > > > Anyway, when i execute this query, i get an error near 'select > > max(value)'... :( > > It's because the subselects are supported from ve

Re[2]: Need help with a query..

2003-12-22 Thread Aleksandar Bradaric
Hi, >> select key, desc, value >> from your_table t1 >> where value = (select max(value) from your_table where desc = t1.desc) > Anyway, when i execute this query, i get an error near 'select > max(value)'... :( It's because the subselects are supported from version 4.1. If you use older MySQL

Re: Need help with a query..

2003-12-22 Thread Aleksandar Bradaric
Hi, > I have already tried the 'rtfm', but it just didn't help. But it's right there :) 3.5.2 The Row Holding the Maximum of a Certain Column > ..and I want to get this with a single query: > +-++--+ > | key | desc| value | > +-++--+ > | 2 | book|

Re: Need help with a query..

2003-12-22 Thread Chuck Gadd
Tibby wrote: ..and I want to get this with a single query: +-++--+ | key | desc| value | +-++--+ | 2 | book| 7 | | 6 | pen | 7 | +-++--+ I need to get only one row from col. DESC, the one with the highest VALUE. With

Need help with a query..

2003-12-22 Thread Tibby
Hi ppl, I have already tried the 'rtfm', but it just didn't help. I have a table: +-++--+ | key | desc| value | +-++--+ | 1 | book| 4 | | 2 | book| 7 | | 3 | book| 5 | | 4 | pen | 4 | | 5 | pen |

Need help with a query, joins, etc.

2003-01-15 Thread Chad Day
I had a query that was working fine before for a sports project .. basically, 3 tables .. one stored goal data, one stored team data, and the other player data. To get all the scoring data (player names, jersey #'s), I left joined to the player table 3 different times (on GOAL, ASSIST1, and ASSIS

Please help with a query

2002-11-27 Thread Chris Boget
This is the query that was given to me: SELECT e.*, c.* FROM correspondence e, certificate c, logins l WHERE c.void <> 1 AND c.uid = l.uid AND l.parent = "wd001" AND e.invoice_num = c.invoice_num AND e.to_uid = "wd001" AND e.actioned= 0 ORDER BY e.message_num Pretty

help with a query accross multiple tables (pt 2)

2002-11-20 Thread Justin French
Hi all, I have the following query i'm running through a PHP script: SELECT DISTINCT board_threads.* FROM board_threads LEFT JOIN board_replies ON board_threads.id = board_replies.threadid WHERE (board_threads.stamp > '{$startDate}' OR board_replies.stamp > '{$startDate}') ORDER BY board_threads

Re: help with a query

2002-08-21 Thread Gerald Clark
Ajay Patel - SunService wrote: >I am a beginner at SQL and would appreciate any help with a simple >query. > >I have two tables: > >host >patch > >The host table contains details for a particular host (OS, cpus, memory, etc) >and the patch table contains patches installed on that host. > >For e

RE: help with a query

2002-08-21 Thread Mary Stickney
select hostid,patch.patchnumber from host left join patch on host.hostid = patch.hostid where patchnumber isnull -Original Message- From: Ajay Patel - SunService [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 2:27 PM To: [EMAIL PROTECTED] Subject: help with a query I am

help with a query

2002-08-21 Thread Ajay Patel - SunService
I am a beginner at SQL and would appreciate any help with a simple query. I have two tables: host patch The host table contains details for a particular host (OS, cpus, memory, etc) and the patch table contains patches installed on that host. For example: Host: hostid hostname

Re: Need help with a query ...

2001-11-04 Thread Anvar Hussain K.M.
Hi John Kelly, This is not a perfect solution but may be useful to you. But still with two queries! From Mysql prompt issue these two queries. SELECT @maxcat := max(Category) FROM table WHERE category = 'Sports:Football:Players' OR category = 'Sports:Football' OR category = 'Sports'; Select

Re: Need help with a query ...

2001-11-02 Thread Bob Hall
On Fri, Nov 02, 2001 at 06:15:08PM -0800, John Kelly wrote: > Hi, I have a MySQL table with a column that contains some of a web site > directory's category names in the format: > > Sports:Football:Players > > I am trying to build a query that that locates all records that match the > above cate

help with a query

2001-11-02 Thread Greg Sarsons
All be the first to admit that I'm new with mysql. I'm looking for some guidance on putting a query together. What I have a database created by snort which is an IDS. The database information of all the packets that crossed a network segment. For example IP src address, IP destination address,

Re: Need help with a query ...

2001-11-02 Thread John Kelly
<[EMAIL PROTECTED]> To: "John Kelly" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, November 02, 2001 7:09 PM Subject: Re: Need help with a query ... > You need to use the LIKE command I think. The MySQL manual should give you > all the details. If you need

Re: Need help with a query ...

2001-11-02 Thread Michael
You need to use the LIKE command I think. The MySQL manual should give you all the details. If you need further help I can just write the whole query out for you. Or was the problem that you only want to worry about the if..then stuff if needed? If so could you tell what your pulling back from tha

Need help with a query ...

2001-11-02 Thread John Kelly
Hi, I have a MySQL table with a column that contains some of a web site directory's category names in the format: Sports:Football:Players I am trying to build a query that that locates all records that match the above category name OR if none exist its parent "Sports:Football" OR if none exist i

Help with a Query

2001-08-21 Thread Fraser Murray
Hi, I need some help with a query I have two queries that I'd like to merge into one - one returns a list of matches that a player has played in, and the other returns the players batting performance. My problem is that a player doesn't always bat, and therefore can have fewer r