Consulta INNER JOIN para autoreferenciar una sola tabla
117 views
Skip to first unread message
Armando Rodríguez B.
unread,
May 31, 2017, 4:45:02 PM5/31/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Comunidad de Visual Foxpro en Español
Amigos de la comunidad.
Solicito apoyo para lograr una consulta a una tabla con autoreferencia
con inner join:
Tabla TAREAS
idTarea NombreTarea idTareaMadre
1 Investigación
2 Presupuestar 1
3 Investigar tendencias 1
4 Presentacion de proyectos 1
Deseo obtener de una consulta con INNER JOIN lo siguiente:
NombreTareaMadre NombreTareaHija
Investigación
Investigación Presupuestar
Investigación Investigar Tendencias
Investigación Presentación de Proyectos
Agradeceré cualquier ayuda que puedan brindarme.
Saludos y gracias
Armando Rodríguez.
Armando Rodríguez B.
unread,
May 31, 2017, 4:52:00 PM5/31/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Comunidad de Visual Foxpro en Español
Amigos de la comunidad.
Solicito apoyo para lograr una consulta SQL - SELECT a una tabla con
Víctor Hugo Espínola Domínguez
unread,
May 31, 2017, 6:12:26 PM5/31/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to publice...@googlegroups.com
Local lcSelect As String
Text To m.lcSelect Textmerge Noshow Pretext 15
Select mad.NombreTarea As NombreTareaMadre , hij.NombreTarea As NombreTareaHija From Tareas As mad Inner Join Tareas As hij On mad.IdTarea = hij.IdTareaMadre Where mad.IdTareaMadre = 0 Union All Select cab.NombreTarea , Space(10) From Tareas As cab Where cab.IdTareaMadre = 0 Order By 1, 2
Endtext
Execscript(m.lcSelect)
Saludos,
Víctor.
Lambaré - Paraguay.
Antonio Meza
unread,
May 31, 2017, 6:31:27 PM5/31/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Comunidad de Visual Foxpro en Español
al hacer eso te ahorras una tabla pero se te complicaran los Select y otras cosas a futuro, es mejor una tabla Madre y una tabla hija y un simple inner join problema resulto.
saludos
Antonio Meza
Armando Rodríguez B.
unread,
May 31, 2017, 7:27:09 PM5/31/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message