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

Sql insert with inner join

I have a table called products. it holds information about all products that we sell. To pull up a specific suppliers products, i do an inner join to another table that holds the supplierid. now i want to add products based on that same supplierid that is stored on the second table.
Jul 15 '10 #1
9 3999
Meetee
931 Expert Mod 512MB
This question is more suitable to DB forum. Moreover, you have not properly described your problem in detail. Please share the table definitions here. Skeleton for inner join is:
Expand|Select|Wrap|Line Numbers
  1. SELECT column_name(s)
  2. FROM table_name1
  3. INNER JOIN table_name2
  4. ON table_name1.column_name=table_name2.column_name
Hope this helps.
Jul 16 '10 #2
I know how to make a regular join. I am not trying to make a regular join. I have a table called products. I have another table suppliers. the products table does not have a supplierid. what i want to do, is create a new product in the products table connecting it to the supplierID in the suppliers table.
Jul 16 '10 #3
NeoPa
32,556 Expert Mod 16PB
We'd like to help, but you haven't actually asked a question.

Welcome to Bytes!
Jul 16 '10 #4
whatever i realize what my problem is thanx anyway
Jul 16 '10 #5
NeoPa
32,556 Expert Mod 16PB
readbanana: I have a table called products. I have another table suppliers. the products table does not have a supplierid. what i want to do, is create a new product in the products table connecting it to the supplierID in the suppliers table.
Are you asking how to link a product in the Products table to a supplier in the Suppliers table but without having a field in the Products table that handles the join?

If so, I'm afraid the answer is that it's not possible. That's the whole point of the field being required in the first place. Joins are done using PK/FK matching. That is Primary Key/Foreign Key matching. Technically any Unique Key can be used in place of a PK, but you need an FK to link to something.

If this isn't what you're asking, could I ask you to explain clearly what that is. It's a bit difficult helping without a question that makes sense. Maybe take a few minutes of your time to ensure it can be understood.
Jul 16 '10 #6
no, i have a field that can join them both - the connect through the productid its more that i'm trying to add a product to the product table and i need to link it to the supplierid in the the suppliers table
Jul 16 '10 #7
NeoPa
32,556 Expert Mod 16PB
There still seems to be some sort of gulf in understanding here. As you provide extremely little in the way of information it's hard for me to determine exactly what it is you're failing to grasp. Hence my request that you give a little more consideration to your reply.

If you have a link already then why do you need further help? If, as I suspect, that link can only identify the product from the supplier, as opposed to the other way around as you seem to require, then you're back where I left you earlier, which is requiring a supplier reference in your product table.

Unless you make the position clearer with your next post I can't imagine I can help you any further.
Jul 16 '10 #8
ok. lets forget this. thanx anyway
Jul 16 '10 #9
NeoPa
32,556 Expert Mod 16PB
New question from the OP was moved to it's own thread (Delete Word in Field).
Jul 16 '10 #10

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

Similar topics

3
by: Ike | last post by:
Oh I have a nasty query which runs incredibly slowly. I am running MySQL 4.0.20-standard. Thus, in trying to expedite the query, I am trying to set indexes in my tables. My query requires four...
4
by: Steve Hall | last post by:
Folks, My secnario involves two tables - ObservationRegister, and Person. ObservationRegister contains most of the "useful" fields, including the UserID of the person that raised the record, and...
4
by: DCM Fan | last post by:
{CREATE TABLEs and INSERTs follow...} Gents, I have a main table that is in ONE-MANY with many other tables. For example, if the main table is named A, there are these realtionships: A-->B...
8
by: kieran | last post by:
Hi, I have the following sql statement. I originally had the statement with two INNER JOINS but in some situations was getting an error so changed the last INNER JOIN to a LEFT OUTER JOIN (as...
4
by: meyvn77 | last post by:
Im using an ADP to connect to a SQL Sqever DB. In access it was really easy to say Inner join on table1 and table2 and update columnA from table1 with columnC from table2 where table1.key =...
4
by: PASQUALE | last post by:
Hi I have a question: do the both statements below give the same result? If yes then does somebody know something about preformance differencies using these joins? SELECT A.* FROM Table1 A...
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...
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...
2
by: MATTXtwo | last post by:
I have this store procedure to select data from table with join like this...SELECT tblPeribadi.Personel_No, tblPeribadi.Nama,tblCompany.Keterangan as Company_Code, tblPeribadi.Jawatan,...
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: 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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.