473,320 Members | 1,922 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

please help, select with keys problem

hi again,

I do have another problem, i do have a database with a peculiar structure. consider these:

table 1: calls

call_type call_ref client_name contact_name

Opportunity 1000 ABC Co. John Doe
Task 1000 DEF Co Jane


table 2: opportunity

opp_id description

1000 potential for 1000 bags order

table 3: task

task_id description

1000 deliver today before noon

Question: How do i make a select statement to show the following:

client_name contact_name call_type description

ABC Co John Doe opportunity potential for 1000 bags order
DEF Co Jane task deliver today before noon

Thanks in advance for all replies.

Cheers!
Feb 28 '07 #1
2 1015
ronverdonk
4,258 Expert 4TB
What is the relation between these 3 tables (to join on common values)? Lookt to me there is none.

Ronald :cool:
Feb 28 '07 #2
i agree... however, it actually has a primary key which has links to other tables which I didn't show because they're not related to what I wanted to get.

going back, if you will look at the three tables, the only other "link" is the "call_type" which should tell us on what table to look for to search for the call_ref. In the first row of table calls, it's call_type is "Opportunity", and on the corresponding table, the row with opp_id=1000 has the description: "potential for 1000 bags order"

as for the second row, the call_type is "Task", and correspondingly, the call_ref on that table 1000 gives the description: "deliver today before noon"

sounds peculiar, isn't it?

unfortunately, this application is an off-the-shelf package running on mysql. I agree that the referencing does not conform to rdbms standards, but I need a script on how to put that on a single report. the initial thing that came into my mind is creating a script from a script and executing it to get the desired results, but I don't think it's a good design.

thanks for the reply, hope you can help.
Feb 28 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: point | last post by:
Hello there.... I hope there's someone who can help with one algorithm...I've been trying the whole day.... I'm building my own FORM class and have a function select(&$options, $name = "",...
4
by: dont bother | last post by:
This is really driving me crazy. I have a dictionary feature_vectors{}. I try to sort its keys using #apply sorting on feature_vectors sorted_feature_vector=feature_vectors.keys()...
6
by: Allan | last post by:
Please help, below is my problem. Let's say I have 2 tables, a Products table and a Colors table that go as follow: Table Products prodID Name 1 shirt 2 tshirt
2
by: Darryll Petrancuri | last post by:
Greetings! I could really use some suggestions on how to improve on the following, it at all possible: Table 'Customer' --------------------- ID GUID PK ....
2
by: m3ckon | last post by:
Hi there, had to rush some sql and am now going back to it due to a slow db performance. I have a db for sales leads and have created 3 views based on the data I need to produce. However one...
4
by: Piper707 | last post by:
I need help with using a general template which would process all tags other than the ones for which specific templates have been written. My XML looks like this: <ITEMS>...
4
by: VK | last post by:
I'm looking for autoexpand <select> list onfocus and collapse it back onselect/onblur (the list is select-one type) I know it is not possible directly, but I've seen here a hack by changing...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
12
by: iKiLL | last post by:
Hi I am new to C#, i have come from a VB6 backgrouond. What i am looking for is a list of the Short cut keys for C# and what they do. I am in perticulare looking for the keys to jump to a...
1
by: Bob | last post by:
Hi, Hope you can help me with this one. I'm at my wits end. I'm trying to create an intelligent edit-box like the excellent "Customer" one at the URL: ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.