![]() |
| ||
| Re: Pulling related data from relational dB re: thread: Problems with a many-to-many inse This may seem like an idiot response but can you clarify what you mean by structure so I don't send you the wrong thing? D |
| ||
| Re: Pulling related data from relational dB re: thread: Problems with a many-to-many inse the table schema, if you want you can send a backup if its small enough |
| ||
| Re: Pulling related data from relational dB re: thread: Problems with a many-to-many Here you go: -- |
| ||
| Re: Pulling related data from relational dB re: thread: Problems with a many-to-many inse thanks, how soon do you need it? cool if i get back with you in the morning? |
| ||
| Re: Pulling related data from relational dB re: thread: Problems with a many-to-many inse Of course ... whenever you can. I appreciate it. Dave |
| ||
| Re: Pulling related data from relational dB re: thread: Problems with a many-to-many inse sure man, will work on it right after i get to work in the morning ...ahhhh, a fresh mind |
| ||
| Re: Pulling related data from relational dB re: thread: Problems with a many-to-many inse this should do the trick, the only problem is if you ever add services, you will need to change the query to reflect that select usr_id_users as USR_ID, airport_id_airport AS AIRPORT_ID, |
| ||
| Re: Pulling related data from relational dB re: thread: Problems with a many-to-many Thanks for this. I will not have a chance to get to it until Friday hopefully but will let you hnow how it goes. Can you explain this statement to me? max(if(service_id_service=1, 1, 0)) as JET I am not sure what the max statement means so a brief explanation to get me started would be appreciated. Thanks a lot for all your time and help. Dave |
| ||
| Re: Pulling related data from relational dB re: thread: Problems with a many-to-many inse basically there will be rows, that will be null (its set to 0 in the the if statement), because the rows are columns, if the service_id != 1 then the row will be null therefore, the max will pull the highest, which will be 1 if the entry is there think of it like for columns JET GROUND and GLYCOL 1 0 0 0 1 0 0 0 1 the max, allows us to group these three rows and select "1" if the service is enabled, although its in a different row let me know if i need to explain it a little better |
| ||
| Re: Pulling related data from relational dB re: thread: Problems with a many-to-many Hey ... just wanted to let you know that I got this working .. and now understand this quite a bit more, thanks to you. I really do appreciate your help. Cheers Dave |
| All times are GMT -4. The time now is 10:36 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC