2
Good afternoon! Please I’m not managing to make a select
I have two tables in the bank (campaign and campanha_clicks)
I need to select only the results with the table type=2 (CAMPAIGN) and at the same time check if in the table campanha_clicks in the id_usuario field is not the user id
I want to show only the data of those who are not yet in the id_user field of the table campanha_clicks
SELECT DISTINCT
c.id,
c.site,
c.cliques_usados,
c.cliques,
c.localizacao,
c.tipo,
c.id_user
FROM
campanha c
INNER JOIN campanha_cliques p
WHERE p.tipo = '2'
AND p.id_usuario != '$uiddw'
tried that but it doesn’t work
And what relates the campaign table to the campanha_cliques table? Or do you just want the Cartesian product of the two tables?
– anonimo
I managed to resolve thanks for the help
– user93341