Jump to content

Recommended Posts

Posted (edited)

Boas,

Inicialmente tinha a seguinte query

select v.*, c.nomeComercial from visitas v,clientespotenciais c WHERE v.nCliente = c.nCliente and v.estado = 0;

por uma questão de optimização criei esta mas dá erro de syntax

select v.*, c.nomeComercial from visitas v, select (nCliente, nomeComercial from clientespotenciais) c WHERE v.nCliente= c.nCliente and v.estado = 0;

Edited by CanonTG
Posted (edited)

Nao podes por assim 2 querys separadas por virgulas...

Nao quererás usar um join?

select v.*, c.nomeComercial
from visitas v
left join clientespotenciais c ON v.nCliente = c.nCliente
where v.estado=0
Edited by Kline777
  • Vote 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.