473,385 Members | 1,487 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.

SQL Statement Help Please

4
I am trying to write a Select Statement. The data I need to get from Table A is Jobno, Stage, Empno, Labourhour, and Compqty, from Table B Jobno, Stage, Partshour and Startqty. Both Jobno and Stage must be equal in both tables. Any help would be greatly appreciated.
Sep 21 '07 #1
6 1002
davef
98
I am trying to write a Select Statement. The data I need to get from Table A is Jobno, Stage, Empno, Labourhour, and Compqty, from Table B Jobno, Stage, Partshour and Startqty. Both Jobno and Stage must be equal in both tables. Any help would be greatly appreciated.
Please provide some more details on the structure of the tables A and B as some joining will probably be in order to correctly pull the dataset that you need. Specifically, your Primary Keys and Foreign Keys in the tables will help.
Sep 21 '07 #2
buddy1
4
Please provide some more details on the structure of the tables A and B as some joining will probably be in order to correctly pull the dataset that you need. Specifically, your Primary Keys and Foreign Keys in the tables will help.
The Primary Key is Jobno, it links all my tables. I'm sorry but I don't know what a foreign key is. This is only my second day with SQL queries.
Sep 21 '07 #3
davef
98
The Primary Key is Jobno, it links all my tables. I'm sorry but I don't know what a foreign key is. This is only my second day with SQL queries.
Try something along the lines of
Expand|Select|Wrap|Line Numbers
  1. select a.Jobno, a.Stage, a.Empno, a.Labourhour, a.Compqty,
  2. b.Partshour, b.Startqty
  3. from A a inner join B b on a.Jobno=b.Jobno
  4.  
Sep 21 '07 #4
buddy1
4
Thanks for the try but it's still not working.
Sep 21 '07 #5
ck9663
2,878 Expert 2GB
Thanks for the try but it's still not working.
what's the error showing up?

Expand|Select|Wrap|Line Numbers
  1.  
  2. select a.Jobno, a.Stage, a.Empno, a.Labourhour, a.Compqty,
  3. b.Partshour, b.Startqty
  4. from TableA a inner join TableB b on a.Jobno=b.Jobno
  5.  
Sep 21 '07 #6
buddy1
4
The error mesage is " Sorry-This is not a valid SQL statement." and that's it.
Sep 24 '07 #7

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

Similar topics

1
by: Jay | last post by:
G'day all This registration form checks for the submit button then displays the next form from the include statement. But before it displays the next form it will check to make sure the user...
15
by: PagCal | last post by:
Is this language missing the functionality of a C/C++ 'continue' statement? For example: While NOT isEof() If condition ' a C or C++ continue would work here ' but we are forced to use a...
19
by: Steve | last post by:
ASP error number 13 - Type mismatch with SELECT...FOR UPDATE statement I got ASP error number 13 when I use the SELECT...FOR UPDATE statement as below. However, if I use SELECT statement without...
14
by: Matt | last post by:
I need to add the following variable into an SQL statement and not sure how to do it. strGCID needs to be inserted into the following statement: SQL = "SELECT tblContacts.* FROM tblContacts...
8
by: Rick | last post by:
I am new to ASP.NET I have worked many years in Coldfusion. I am having a problem finding out how to put an IF Statement into the HTML. How do I do this in ASP.NET? Thanks for any help you can...
4
by: uarana | last post by:
Hi All, Please advise. i'm loosing sleep over this form :(. The statement was working perfectly a little while ago but i don't know what happened. I didn't modify any fields in the table. ...
6
by: Kbalz | last post by:
Trying to run a simple query on my dataset the SQL statement looks like this: select * from person where id in (@p) When using more than one id in the "in statement", I get...
9
by: maas | last post by:
Hello I have a problem when coding the statement stmt.execute("insert into Member values ("+mname+" ,"+mail+","+tel+")"); where mname, mail,tel are variables which the user inputs them and...
18
by: dspfun | last post by:
Hi! The words "expression" and "statement" are often used in C99 and C- textbooks, however, I am not sure of the clear defintion of these words with respect to C. Can somebody provide a sharp...
1
by: robin1983 | last post by:
Dear All, I got stuck in simple problem, I have a two php file one for registration form and one for to check and insert into the table. The problem is that when I get any kind error in...
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
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...

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.