google OUTER join. On Mon, Mar 31, 2014 at 3:07 PM, Lucas Aimaretto <laimaretto@xxxxxxxxx>wrote: > Hi everyone, > > Today, whenever I want to gather the list of ports and their connections I > use the following SQL query: > > SELECT > ro1.name AS obj1, > p1.label as p1_desc, > p1.name AS port1, > Link.cable, > p2.name AS port2, > p2.label as p2_desc, > ro2.name AS obj2 > FROM RackObject AS ro1 > JOIN Port AS p1 ON(ro1.id=p1.object_id) > JOIN Link ON(p1.id=Link.porta) > JOIN Port AS p2 ON(Link.portb=p2.id) > JOIN RackObject AS ro2 ON(p2.object_id=ro2.id) > WHERE ro1.name like '%CF129%' or ro2.name like '%CF129%' > ORDER BY obj1, port1; > > However, this query does not get the list of unused ports. Does anyone > know how to accomplish this? > > BR! > > Lucas > > -- > "Antes teníamos hambre y mirábamos el reloj para saber qué hora era. Ahora > miramos el reloj para saber si tenemos hambre." -- Ernesto Sábato > -- Michal Sochoń alias _KaszpiR_ kaszpir@xxxxxxxxx IRC: _KaszpiR_ @ freenode.net