Extracting from two queries is really not much different from extracting from one; you just do it twice.
I'd actually run two separate loops, myself; one to get the orgnums in table2 (putting them into an array), and one to get companies and orgnums from table1.
$companies_with_links=array();
$query = 'select distinct orgnum from table2';
$results = mysql_query($query);
while($row = mysql_fetch_array($results)
$companies_with_links[]=$row['orgnum'];
Then do your query on table1 and loop through the results of that, pretty much as you're already doing. Whenever you want to see if a company should have a link or not, use in_array() to see if its orgnum is in $companies_with_links.
Eg.
$columns = 2;
$query = "SELECT company, orgnum FROM table1 ORDER BY company";
$result = mysql_query($query);
$num_rows = mysql_num_rows($result);
$rows = ceil($num_rows / $columns);
for($i=0; $i<$num_rows; $i++)
{ $data[$i] = mysql_fetch_array($result);
}
echo "<table>\n";
for($i = 0; $i < $rows; $i++)
{
echo "<td>\n";
for($j = 0; $j < $columns; $j++)
{
$index = $i+$j*$rows;
if($index>=$num_rows)
break;
$company = $data[$index]['company'];
$orgnum = $data[$index]['orgnum'];
if(!in_array($orgnum, $companies_with_links))
{
echo "<td>" . ucwords(strtolower($company)) . "</td>\n";
}else
{
echo "<td><a href=\"companyinfo.php?company=" . $orgnum . "\">" .
ucwords(strtolower($company)) . "</a></td>\n";
}
echo "<td width=\"5\">" . "</td>\n";
}
echo "</tr>\n";
}
echo "</table>\n";
which includes a couple of other simplifications.