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")))