Re: complicated query | no Sub query

2005-05-24 Thread Anoop kumar V
Thanks Peter - you gave me some ideas... here is what I have so far (simplified for simplification..) select t2.dt_aud_rec, t1.id_secr_rqst from isr2_aud_log t1, isr2_aud_log t2 where t1.id_secr_rqst=t2.id_secr_rqst and t1.dt_aud_rec t2.dt_aud_rec group by t1.id_secr_rqst but the problem is

Re: complicated query | no Sub query

2005-05-24 Thread SGreen
Anoop kumar V [EMAIL PROTECTED] wrote on 05/24/2005 03:02:11 PM: Thanks Peter - you gave me some ideas... here is what I have so far (simplified for simplification..) select t2.dt_aud_rec, t1.id_secr_rqst from isr2_aud_log t1, isr2_aud_log t2 where t1.id_secr_rqst=t2.id_secr_rqst and

Re: complicated query | no Sub query

2005-05-24 Thread Anoop kumar V
My profound apologies here is the table create structure. the biggest problem i think is that this table does not have any primary keys or atleast unique columns: (I think joins require unique columns) mysql show create table isr2_aud_log\G *** 1. row

complicated query | no Sub query

2005-05-23 Thread Anoop kumar V
hi All, I need to create a query using no subqueries as I use 4.0.23 which does not support subqueries. I cannot upgrade for some compellimg reasons (the product does not support anything later than 4.0.23nt as of now). I also cannot use any thing that is native to mysql - in the sense that

RE: complicated query | no Sub query

2005-05-23 Thread Peter Normann
Hi Anoop Try: SELECT t1.id_secr_rqst, t2.name_rec_type, t1.dt_aud_rec FROM isr2_aud_log t1, isr2_aud_log t2 WHERE t1.id_secr_rqst = t2.id_secr_rqst AND t1.name_rec_type='Exception Resource' ORDER by t1.dt_aud_rec DESC LIMIT 2; Peter Normann -- MySQL General Mailing List For list archives:

Re: complicated query | no Sub query

2005-05-23 Thread Anoop kumar V
Thanks Peter - but I see two issues: 1. It returns data about only one id_secr_rqst - I want it to return data about every id_secr_rqst in the table. 2. Limit IMO is mysql specific (I hope I am wrong) is there something generic so I dont need to bother about which database I am running it

RE: complicated query | no Sub query

2005-05-23 Thread Peter Normann
Anoop kumar V mailto:[EMAIL PROTECTED] wrote: 1. It returns data about only one id_secr_rqst - I want it to return data about every id_secr_rqst in the table. So, if I understand you correctly (sorry, having a bad day), you want all records for the past two days? Assuming this, you could use

RE: complicated query | no Sub query

2005-05-23 Thread Peter Normann
Anoop kumar V mailto:[EMAIL PROTECTED] wrote: well - actually it might not be the last 2 days - i just want 2 of the latest records for every task regardless of what date it is in the table. Okay, now I think I understand what you need - and if I am correct, this looks like one of the more

Re: Complicated Query

2005-01-24 Thread Ian Sales (DBA)
Ron Watson wrote: This works, but only if a title and a role exists for the company member. Basically, I want to display the season name from tbl Season, then the show title from tbl Shows, then the roles from cast and titles from production_team for the company member. - use LEFT JOINs. -

Complicated Query

2005-01-23 Thread Ron Watson
Hello. I'm looking for some help on a complicated query. I have data in 5 different tables I want displayed on this page. The query I have now is $query = SELECT Shows.Season_RID AS SEASON_NUM, Shows.Show_Name AS NAME, Shows.Show_RID

Complicated query problem

2004-05-05 Thread Jack Coxen
I've got the following query that produces a large table for me. SELECT router.name AS Router, SUM(IF(speed='64000',1,0)) AS 64K, SUM(IF(speed='128000',1,0)) AS 128K, SUM(IF(speed='192000',1,0)) AS 192K, SUM(IF(speed='256000',1,0)) AS 256K, SUM(IF(speed='384000',1,0)) AS

Re: Complicated query problem

2004-05-05 Thread beacker
The query as written works just fine although I'm certain there's got to be a more efficient way of doing the same thing. I'm relatively new to MySQL so I took the brute force approach. My problem is that I want to produce totals of each of the columns and can't figure out how to do it. Any

Complicated query. query help

2002-11-13 Thread TimeWalker
I've been trying to work out a complicated query to select and sum multiple columns in one select using a condition and multi column group by What I expected to get was ONE row with the columns summed . this query returns 5 rows SELECT sum(`AllTheWeb`),sum(`AltaVista`),sum(`AOL`),sum(`Ask

Re: Complicated query. query help

2002-11-13 Thread Roger Baklund
* TimeWalker I've been trying to work out a complicated query to select and sum multiple columns in one select using a condition and multi column group by What I expected to get was ONE row with the columns summed . this query returns 5 rows SELECT sum(`AllTheWeb`),sum

complicated query

2002-11-08 Thread Terry
hi, i am trying to move one of the databases we have in access to mysql and i have come accross a query that mysql doesnt like: SELECT Managers.Manager, Agents.Agent, Modules.Module, Messages.MLevel, Messages.Title, MessageInstance.Name, MessageInstance.Info, PolicyRuns.JobNo, Policies.Policy

Complicated Query?

2002-01-09 Thread Jerry Rehak
I have a table with the columns names and id. I want to be able to find all names with an id of '03' that do not have other records with id values of '10','20' or '37'. Is this even possible to do? name id a03 a11 a12 a13 I want 'a' because it has a 03 and

RE: Complicated Query?

2002-01-09 Thread Rick Emery
Needs to be done programmatically -Original Message- From: Jerry Rehak [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 09, 2002 10:53 AM To: [EMAIL PROTECTED] Subject: Complicated Query? I have a table with the columns names and id. I want to be able to find all names with an id

RE: Complicated Query?

2002-01-09 Thread Roger Baklund
* Jerry Rehak I have a table with the columns names and id. I want to be able to find all names with an id of '03' that do not have other records with id values of '10','20' or '37'. Is this even possible to do? name id a 03 a 11 a 12 a 13 I want 'a' because

Please help!!!!!!Re: order by...group by...complicated query

2001-09-01 Thread hassan el forkani
hi, i am trying to build a message board in php with mysql as back end; what i want to do is to query the database in a certain way that the result is returned in the correct order for php to display the discussion thread properly here is my table structure: mysql show fields from posts

order by...group by...complicated query

2001-08-31 Thread hassan el forkani
hi, i am trying to build a message board in php with mysql as back end; what i want to do is to query the database in a certain way that the result is returned in the correct order for php to display the discussion thread properly here is my table structure: mysql show fields from posts

Re: complicated query

2001-04-23 Thread Milo Stefani
try ORDER BY (Category = 'Other'), Category, Subcategory It should work, (I hope ^_-;;;) - Original Message - From: Jeff Shipman - SysProg [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, April 20, 2001 8:38 PM Subject: complicated query I would like to do something similar

Complicated Query...

2001-04-23 Thread
Hi there, I'm having a problem on my complicated query. My question is similar to the question in a couple of emails earlier in this mailing list which subject's is complicated query. I got 3 tables below. test1 table ++--+ | id | name | ++--+ | 1 | fumi | | 2 | ali | | 3

complicated query

2001-04-20 Thread Jeff Shipman - SysProg
I would like to do something similar to an ORDER BY in one of my select statements, but I'mt not sure how to do something as complicated as this: I have two columns, category and subcategory, that I am retrieving. I would like category and subcategory to be sorted alphabetically. This is easy

RE: complicated query

2001-04-20 Thread Braxton Robbason
with an a as far as the order by is concerned, while other is zz for sorting purposes. -Original Message- From: Jeff Shipman - SysProg [mailto:[EMAIL PROTECTED]] Sent: Friday, April 20, 2001 2:39 PM To: [EMAIL PROTECTED] Subject: complicated query I would like to do something similar

Re: complicated query

2001-04-20 Thread Steve Werby
"Jeff Shipman - SysProg" [EMAIL PROTECTED] wrote: I would like to do something similar to an ORDER BY in one of my select statements, but I'mt not sure how to do something as complicated as this: I have two columns, category and subcategory, that I am retrieving. I would like category and

Re: complicated query

2001-04-20 Thread Rick Pasotto
On Fri, Apr 20, 2001 at 03:39:59PM -0400, Steve Werby wrote: "Jeff Shipman - SysProg" [EMAIL PROTECTED] wrote: I would like to do something similar to an ORDER BY in one of my select statements, but I'mt not sure how to do something as complicated as this: I have two columns, category

Re: complicated query

2001-04-20 Thread Jeff Shipman - SysProg
} } You don't need to create another column, just use: } } ORDER BY category = 'other', category } Are you sure this works? My query is: select category,subcategory from categories ORDER BY category = 'other', category; And I get: ERROR 1064: You have an error in your SQL syntax near '=

RE: complicated query

2001-04-20 Thread Jeff Shipman - SysProg
, while other is zz for sorting purposes. } } } -Original Message- } From: Jeff Shipman - SysProg [mailto:[EMAIL PROTECTED]] } Sent: Friday, April 20, 2001 2:39 PM } To: [EMAIL PROTECTED] } Subject: complicated query } } } I would like to do something similar to an ORDER BY } in one of my

Re: complicated query

2001-04-20 Thread Rick Pasotto
On Fri, Apr 20, 2001 at 03:09:32PM -0600, Jeff Shipman - SysProg wrote: } } You don't need to create another column, just use: } } ORDER BY category = 'other', category } Are you sure this works? My query is: select category,subcategory from categories ORDER BY category = 'other',