I want to get all the emails from a table usuarios
, and only one email from the table empresa
.
I have this to get the emails from a table, but how can I add another one SELECT
so that they come out together? and then be able to use this data. I had thought something like that, but I'm not sure I'm doing it right
SELECT usuario.email FROM usuario
WHERE usuario.tipo_usuario='usuario' AND usuario.bolsa_ofertas='activado'
(SELECT empresa.email FROM empresa WHERE empresa='ejemplo');
I don't know if the following query will be useful to you:
Since I don't know the related fields of the user and company tables, I'll give you an example of how it could be if it works for you:
SELECT u.user.email, e.company.email from user u, company e where e.cod.company=u.cod.user