hi all
i am a newbie want to know how to get values from two tables in database. I hae two tables one is the personla information and the other table is the salary table .Both tables have id number which may join them to gather. But what i need to do is, i need to retrieve only people who have a salary of 2500. Is it possible. i have tried below but it does not work can tell me where i went wrong
You need to store the personalinformation.id in salarydetails table. after that you need to link the personalinformation.id ane the personalinformation.id stored in salarydetails table.
i have pasted the code above already bro.....Because i need to save the values in a different table within the database. so i have a table called details. so i need to put all these generated values from the two tables into this table. when i tried compiling i get this error. invalid syntax.......attached down is my query string to place the values in another table. ihope this info issufficient ..... please help
Quote ...
Dim myQuery as String = " INSERT INTO details(name,position,age,salary) values AS (select personalinformation.name,personalinformation.position,personalinformation.age,salarydetails.salary
FROM personalinformation, salarydetails
WHERE personalinformation.id = salarydetails.id
AND salarydetails.salary = 2500)"
Last edited by newbie_here; Mar 2nd, 2009 at 1:55 am.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.