Re: Complicated select query

2006-03-28 Thread Pure Web Solution
try something like this select customer,max(time),name from customers join projects on projects.parent_id=customer.id group by customer; regards Pure Web Solution http://www.purewebsolution.co.uk PHP, MYSQL, Web Design & Web Services Barry <[EMAIL PROTECTED]> wrote: > Gabriel PREDA wrote: > >

Re: Complicated select query

2006-03-28 Thread Barry
|06|03 |My small Project|2005-02-10| |07|03 |My big Project! |2005-06-11| Small mistake. The project with ID 06 should have a date above ID 07. Sorry for that! -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- MySQL General Mailing List For li

Re: Complicated select query

2006-03-28 Thread Barry
Gabriel PREDA wrote: About the first problem I think you need to give us more data ! Okay i thought yesterday how i can make up some real problem and have this: Guess you have a database with customers and a database with projects. Those prijects have timestamps so you know what time he added

Re: Complicated select query

2006-03-27 Thread Peter Brawley
Barry, Hello Everyone! Probably somone can help me out. I have 2 databases and it looks like: (Wayne Ratliff is dead but his mistake lives on :-) ). You mean tables, right? db1 Project 1 db2 Subproject 1 db2 Subproject 2 db1 Project 2 db2 Subproject 1 db1 Project 3 db2 Subproject 1

Re: Complicated select query

2006-03-27 Thread Gabriel PREDA
About the first problem I think you need to give us more data ! As for the seccond... I haven't sen such loops yet... But you can go arround them and do something like: SELECT * FROM db WHERE (id BETWEEN 5 AND 50) AND id%5=0 -- Gabriel PREDA Senior Web Developer

Complicated select query

2006-03-27 Thread Barry
Hello Everyone! Probably somone can help me out. I have 2 databases and it looks like: db1 Project 1 db2 Subproject 1 db2 Subproject 2 db1 Project 2 db2 Subproject 1 db1 Project 3 db2 Subproject 1 db2 Subproject 2 db2 Subproject 3 What kind of a query would give me the first Subproj

Re: A Complicated SELECT query

2004-12-30 Thread Sasha Pachev
shaun thornburgh wrote: Hi, The following query returns the amount of hours a user has been booked for on a particular day. SELECT (SUM(((DATE_FORMAT(B.Booking_End_Date, "%k") * 60 ) + DATE_FORMAT(B.Booking_End_Date, "%i")) - ((DATE_FORMAT(B.Booking_Start_Date, "%k") * 60 ) + DATE_FOR

A Complicated SELECT query

2004-12-29 Thread shaun thornburgh
Hi, The following query returns the amount of hours a user has been booked for on a particular day. SELECT (SUM(((DATE_FORMAT(B.Booking_End_Date, "%k") * 60 ) + DATE_FORMAT(B.Booking_End_Date, "%i")) - ((DATE_FORMAT(B.Booking_Start_Date, "%k") * 60 ) + DATE_FORMAT(B.Booking_Start_Date, "%i")))

Re: complicated select statements and out of memory errors

2004-03-02 Thread Sasha Pachev
Bernd Jagla wrote: Hi there, I have some rather complicated sql statements that seem to eat up all resources from mysqld. Once I have two of them running at the same time no one can log on any more. Simple queries involving distinct get a out of memory error. We have tried changing the index buf

complicated select statements and out of memory errors

2004-03-01 Thread Bernd Jagla
Hi there, I have some rather complicated sql statements that seem to eat up all resources from mysqld. Once I have two of them running at the same time no one can log on any more. Simple queries involving distinct get a out of memory error. We have tried changing the index buffer size from 256M

complicated select

2002-01-08 Thread P.Agenbag
Hi, I have a table that contains something like follows: id prop_name status action_date prop_type address 1 name1 ok 2001-12-12 1 addy1forname1 2 name2