Help in table query

i have 2 table which one table display the value.

this is the query one of the table…


<?php
$open=mssql_query("Select * from tblTicket ");
while($row=mssql_fetch_array($open))
{
?>
<tr>
	<td><?php echo "<a href='Ticketmanage.php?id={$row['TickNo']}'> $tick</a>"?></td>
	<td><?php echo $name ?></td>
	<td><?php echo $row['DateCreate']?> </td>
	<td><?php echo $row['TimeCreate']?> </td>
	<td><?php echo $row['Category']." (".$row['Subcat'].")"?></td>
</tr>
<?php
}

?>

and if the said value above exist on this table (TBLAssign)
the said value must not print on the top query…

Help…Thanks…

I think you are looking for:

SELECT * FROM tblTicket WHERE TickNO NOT IN (SELECT TickNO FROM tblAssign)

Thanks…is this applicable in PK and FK.
the tblTicket is where the PK and tblAssign is where the FK…