| | |
Crazy CrossTab problems
Please support our MS SQL advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Dec 2008
Posts: 9
Reputation:
Solved Threads: 0
Hi there,
I'm completely lost.
I have 3 tables:
- work (workID, description)
- machine (machineID, name)
- work_machine (machineID, workID, hours)
What I want is to obtain a result similar to:
work, machine1, machine2
A , 1 ,
B , 3 , 5
The problem is that the number of works and the number of machines is unknown.
Can anyone help?
I'm completely lost.
I have 3 tables:
- work (workID, description)
- machine (machineID, name)
- work_machine (machineID, workID, hours)
What I want is to obtain a result similar to:
work, machine1, machine2
A , 1 ,
B , 3 , 5
The problem is that the number of works and the number of machines is unknown.
Can anyone help?
Muke, seems you didn't normalize your database design!!
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
What's machine1 and machine2 ?? and what '0' in the first row in output?
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
As I said, you've lack in your design, I am sorry but your database design is wrong. It need some normalization
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Hi again! Maybe you can try reading this: some-thread-on-sums.
Or this one @ daniweb.
Or ask RamyMahrous to describe the proper table structure. =)
Or this one @ daniweb.
Or ask RamyMahrous to describe the proper table structure. =)
If you know ASP, you can save other daniweb members from idiots like me by helping out in this forum.
Visit this thread if your username starts with one of the following letters: B D F H J L N P R T X Y Z.
Visit this thread if your username starts with one of the following letters: B D F H J L N P R T X Y Z.
•
•
Join Date: Dec 2008
Posts: 9
Reputation:
Solved Threads: 0
Hi RamyMahrus,
my DB design is the following:
I have 3 tables:
- work (workID, description)
- machine (machineID, name)
- work_machine (machineID, workID, hours)
Can you tell me what's wrong?
my DB design is the following:
I have 3 tables:
- work (workID, description)
- machine (machineID, name)
- work_machine (machineID, workID, hours)
Can you tell me what's wrong?
That's correct give me real sample data to all these tables + output you need not table just in english text what you need to extract from these tables.
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
![]() |
Other Threads in the MS SQL Forum
- Previous Thread: Need help in getting Average using SQL Cross Tab
- Next Thread: Get last month from timestamp
| Thread Tools | Search this Thread |






