473,419 Members | 1,963 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,419 software developers and data experts.

Inner join displaying data that appears multiple time in query

147 100+
Not sure if this is for SQL or .net! I have 2 tables which looks like

table1
ID Name
1 Jon

and

table2
ID Number Job
1 1 IT
2 1 Web
3 1 Admin


An inner join makes one table with 3 rows (I excluding the ID from table 2 for the join) which is saved as a view

viewTable
ID Name Number Job
1 Jon 1 IT
2 Jon 1 Web
3 Jon 1 Admin

I want to display these results on a web page via the grid view. However, I don't want to show the user 3 times, but I do want to show each job. ideally:

ID Name Number Job Job Job
1 Jon 1 IT Web Admin

(I know the above won't work because of the duplicated column titles - it is for visual aid only)

What is the best way to do this? Is there a fault with the database design already?

Dave
Mar 10 '10 #1

✓ answered by ck9663

You can do that in your front-end, too. In T-SQL, you have to PIVOT/UNPIVOT your result set to do what you want.

Good Luck!!!

~~ CK

2 1934
ck9663
2,878 Expert 2GB
You can do that in your front-end, too. In T-SQL, you have to PIVOT/UNPIVOT your result set to do what you want.

Good Luck!!!

~~ CK
Mar 10 '10 #2
DaveRook
147 100+
Perfect. Thank you.

FYI for any one else who finds this post

http://msdn.microsoft.com/en-us/library/ms177410.aspx
Mar 10 '10 #3

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

Similar topics

7
by: Barry Young | last post by:
I am using Access to create a SQL query. It creates an Inner Join Query. I cut and paste the query into PL-SQL. When I try to execute the query I get an error. ORA 933 SQL command not properly...
3
by: Prem | last post by:
Hi, I am having many problems with inner join. my first problem is : 1) I want to know the precedance while evaluating query with multiple joins. eg. select Employees.FirstName,...
7
by: Shanimal | last post by:
I would like to know how to join 2 queries so that the results of these 2 queries show up in the same query: SELECT b.bios_serial_number FROM bios b: SELECT s.system_name FROM system s; ...
6
by: dmonroe | last post by:
hi group -- Im having a nested inner join problem with an Access SQl statement/Query design. Im running the query from ASP and not usng the access interface at all. Here's the tables: ...
52
by: MP | last post by:
Hi trying to begin to learn database using vb6, ado/adox, mdb format, sql (not using access...just mdb format via ado) i need to group the values of multiple fields - get their possible...
3
by: Zeff | last post by:
Hi all, I have a relational database, where all info is kept in separate tables and just the id's from those tables are stored in one central table (tblMaster)... I want to perform a query, so...
2
by: Rick | last post by:
VS 2005 & Firebird DB 1.5 I have a query for Customer orders that has several inner joins to show things like Terms name (from termsnum) and Sales Rep name (from repnum) etc. I have written...
12
by: Chamnap | last post by:
Hello, everyone I have one question about the standard join and inner join, which one is faster and more reliable? Can you recommend me to use? Please, explain me... Thanks Chamnap
14
by: cjakeman | last post by:
Hi, Solved a little mystery yesterday when I built a form that combined 2 tables with a 1:M relationship and relational integrity. All the correct data was visible on the form but, if I tried to...
4
by: AXESMI59 | last post by:
I created a query in the Access Query Builder that I modified to use with VBA Code so I could reuse it for any record I choose. The one that I created with the Access Query builder works beautifully...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.