I have 2 tables:
Users [Id, UserType, Email, Password]
Clients [Id, TypeUser, Email, Password, UltimaSesion]
I have created a login query through the Email and password looking in both tables to know if it is a User of the company or a client:
SELECT Usuario.Id, Usuario.TipoUsuarioId, CONCAT(Usuario.Nombre, ' ', Usuario.Apellidos) AS UsuarioNombre,
Usuario.TipoPerfilId, TipoUsuario.PaginaInicio
FROM Usuario INNER JOIN TipoUsuario
ON Usuario.TipoUsuarioId = TipoUsuario.Id
WHERE Usuario.Email = @Email AND Usuario.Password = @Password COLLATE SQL_Latin1_General_CP1_CS_AS
AND Usuario.Status = 1
UNION ALL
SELECT Cliente.Id, Cliente.TipoUsuarioId, CONCAT(Cliente.Nombre, ' ', Cliente.Apellidos) AS UsuarioNombre,
'0' AS TipoPerfilId, TipoUsuario.PaginaInicio
FROM Cliente INNER JOIN TipoUsuario
ON Cliente.TipoUsuarioId = TipoUsuario.Id
WHERE Cliente.Email = @Email AND Cliente.Password = @Password COLLATE SQL_Latin1_General_CP1_CS_AS
AND Cliente.Status >= 3
Now, what I need is to update the client table to set the current date in its "UltimaSesion" field.
Is it possible to do this within my current query?