![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Hi, I'd like to know if this query below is feasible in one single SQL statement. If not, I'll have to merge 2 sets of table and I'd like to avoid this if possible. Specs: --------- Table VPN_A: AutoId (int, auto inc) NodeName (Text) Table VPN_B: AutoID (int, auto inc) NodeName (Text) Table Nodes_A: AutoID (int, auto inc) ParentID (int, FK: VPN_A.AutoID) NodeDesc (Text) Table Nodes_B: AutoID (int, auto inc) ParentID (int, FK: VPN_B.AutoID) NodeDesc (Text) I'd like to have all distinct records from Nodes_A and Nodes_B Where Nodes_A.Parent_ID = VPN_A.AutoID and Nodes_B.Parent_ID = VPN_B.AutoID But so far I'm getting lots of duplicates, even when I try a GROUP BY. Thanks for your help. |
#4
| |||
| |||
|
|
For starters -- display what the source data looks like and what you want to the result dataset to look like: table: *VPN_A * * * * * * table: VPN_B AutoID * NodeName * * * * AutoID *NodeName * 1 * * * * a1 * * * * * * *1 * * * *b1 * 2 * * * * a2 * * * * * * *2 * * * *b2 .. table: Nodes_A * * * * * * *table: Nodes_B AutoID ParentID *NodeDesc * AutoID *ParentID *NodeDesc .. Result Dataset -- Rich *** Sent via Developersdexhttp://www.developersdex.com*** |
#5
| |||
| |||
|
|
For starters -- display what the source data looks like and what you want to the result dataset to look like: table: *VPN_A * * * * * * table: VPN_B AutoID * NodeName * * * * AutoID *NodeName * 1 * * * * a1 * * * * * * *1 * * * *b1 * 2 * * * * a2 * * * * * * *2 * * * *b2 .. table: Nodes_A * * * * * * *table: Nodes_B AutoID ParentID *NodeDesc * AutoID *ParentID *NodeDesc .. Result Dataset -- Rich *** Sent via Developersdexhttp://www.developersdex.com*** |
#6
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |