I have two tables: Con and CFSK Both tables have a common column: ConID
Con has the following columns (atleast the ones I care about: ConID, Firstname, Lastname, SSN, DOB, HDate) CFSK has the following columns: Keyval, ConID, SystemID, Active, StChDt
Usually I do this:
SELECT *
FROM Con
WHERE Firstname = 'Jon'
and Lastname = 'Snow'
After I run this, I copy the value for ConID (let's say it is 99999) then run it against the CFSK table:
SELECT *
FROM CFSK
WHERE ConID IN (99999)
I would like to have a SQL script which consolidates both of these commands.
So let's say for example, I want to find what entries Arya Stark has in the CFSK table. I would like a script where the user has to enter only the Firstname, Lastname and it shows the columns for BOTH tables that I have mentioned above.
Any idea? Sorry I'm a noob in SQL, tried a couple noobie tricks, none worked. :( Any help would be greatly appreciated.
THANK YOU GUYS FOR YOUR KIND ANSWERS! Solved my problem, all of them are good answers! :) You guys are beautiful!