Hello,
I am hoping you can help me with a small problem. Below are two pieces of SQL. The first is the way it should be, the second is what happens to it after I close and open the database.
BEFORE
AFTER
This is problematic because other queries function off of this one. It isn't hard to fix, but in the interest of efficiency, I don't want to have to fix it every day. Any advice you can offer is appreciated.
Thanks,
Elysynn
I am hoping you can help me with a small problem. Below are two pieces of SQL. The first is the way it should be, the second is what happens to it after I close and open the database.
BEFORE
Code:
SELECT qryNode1.UserNumber, qryNode1.type_id, dbo_user_aliases.alias
FROM qryNode1 INNER JOIN dbo_user_aliases ON (qryNode1.UserNumber = dbo_user_aliases.user_id) AND (qryNode1.type_id = dbo_user_aliases.type_id) AND (qryNode1.last_activity = dbo_user_aliases.last_activity);
AFTER
Code:
SELECT A.last_activity, A.user_id AS UserNumber, A.type_id
FROM qryNode AS A INNER JOIN [SELECT user_id, Max(last_activity) AS LastUpdate FROM qryNode GROUP BY user_id]. AS L ON (A.user_id = L.user_id) AND (A.last_activity = L.LastUpdate);
This is problematic because other queries function off of this one. It isn't hard to fix, but in the interest of efficiency, I don't want to have to fix it every day. Any advice you can offer is appreciated.
Thanks,
Elysynn