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

mapping of row in one table to column in another table?

i have a data set where in i take value from one table which itself is a column in another table. it would look something like this.

TABLE1

ID CATEGORY ACTIVITY
551 ML ART
552 PTL SWEEPS
553 RDC PIPO
554 ML PIPO

TABLE2

ACTIVITY ML PTL RDC
ART 10 15 15
PIPO 15 15 11
SWEEPS 12 10 15

NOW SUPPOSE I WANT FOR 551 ID AND CATEGORY 'ML' IN TABLE1 TO FETCH VALUE OF ML i.e '10' IN TABLE2 FOR ACTIVITY 'ART'.
how do i do this in sql?
Thanks in advance.
Jan 2 '14 #1
1 1745
Rabbit
12,516 Expert Mod 8TB
The problem is that your table is improperly designed in that it is not normalized. You should not have a field for each category, instead, you should just have a category field like you do in table1. That way you can join on activity and category to get the value.

For more information, please read our article on normalization: http://bytes.com/topic/access/insigh...ble-structures
Jan 2 '14 #2

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

Similar topics

9
by: Deja User | last post by:
This is probably very simple but I can't figure out a way to update one table from another table. Here is an example: ------ TABLEA ------ first_name last_name
1
by: Mike9900 | last post by:
What is the best way to copy DataRow from one table to another table, without copying its structure, which means copying only its data. -- Mike
1
by: thengfen | last post by:
Hi! Im having a problem in transfering a set of records from a table to another table. The scenario is when i select combo box (Course taken such as diploma in IT), then the process will...
1
by: Sakakini | last post by:
How can I append last entry from one table to another table???
4
by: xoozlez | last post by:
Hi there, How do I insert new records from a dbo table to another table? This is what I have: 1 dbo_company 1 Member (table) I made a query in dbo_company with the criteria I only want to...
3
by: anil2083 | last post by:
How to migrate the comma separated values from one table to another table? suppose we have table i.e XYZ and we have comma separated values in few columns i.e( column_name and values are...
3
by: shubham rastogi | last post by:
hello guys I want to copy or insert records into the previously created table from another table.. For example I have two tables A and B .... I want to copy or insert records from table B into...
2
by: amitsukte | last post by:
Hi Everyone how should i update multiple columns of a table from another table... Suppose I have table A and B and having four columns each table A(col1,col2,col3,col4) B(col1,col2,col3,col4) ...
1
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.