Ver Mensaje Individual
  #2 (permalink)  
Antiguo 17/03/2009, 07:30
ilie
 
Fecha de Ingreso: agosto-2008
Mensajes: 218
Antigüedad: 15 años, 8 meses
Puntos: 7
Respuesta: consulta dentro de consulta

para listar todos:
select clientes(*), categorias(categoria), tipos(tipo) from clientes, categorias, tipos
where clientes.tipo = tipos.tipoid
and clientes.categoria = categoriaid
order by tipos.tipo, categorias.categoria, [Datos de los clientes]

Para uno en concreto:
select clientes(*), categorias(categoria), tipos(tipo) from clientes, categorias, tipos
where clientes.tipo = tipos.tipoid
and clientes.categoria = categoriaid
and categorias.categoria = 'CATEGORIA' /*puede en vez del nombre su id*/
and tipos.tipo = 'TIPO' /*puede en vez del nombre su id*/
order by tipos.tipo, categorias.categoria, [DATOS de los clientes]