I thought this would be a simple task but i cannot figure out why this gives me an error in my syntax. Any help is appreciated.
DECLARE @usernameid VARCHAR(20);
declare @UserIDParam VARCHAR(20);
SET @usernameid = 'myid';
SET @UserIDParam =
(SELECT userid
FROM tblusers
WHERE unid = usernameid);
SELECT *
FROM tblusers
WHERE tblusers.userID = @useridparam
SELECTquery with a SQL join?