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.
6 1002
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.
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.
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 -
select a.Jobno, a.Stage, a.Empno, a.Labourhour, a.Compqty,
-
b.Partshour, b.Startqty
-
from A a inner join B b on a.Jobno=b.Jobno
-
Thanks for the try but it's still not working.
Thanks for the try but it's still not working.
what's the error showing up? -
-
select a.Jobno, a.Stage, a.Empno, a.Labourhour, a.Compqty,
-
b.Partshour, b.Startqty
-
from TableA a inner join TableB b on a.Jobno=b.Jobno
-
The error mesage is " Sorry-This is not a valid SQL statement." and that's it.
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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.
...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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,...
|
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$) {
}
...
|
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...
|
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...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
| |