I have the following table (Oracle 8):<BR><BR>ORDERS<BR><BR>Message_line,<BR>Message_ ID,<BR>Type (wheter it beeing a &#039;H&#039; (order head) or &#039;R&#039; (order row),<BR>Status (Complete or Incomplete)<BR><BR>Message_line together with message_id makes the row unique.<BR><BR>A typical order:<BR><BR>1, 12345, H, COMPLETE, ... other order head informaton here ...<BR>2, 12345, R, COMPLETE, ... orderitem #1 info.....<BR>3, 12345, R, INCOMPLETE, ... orderitem #2 info...<BR><BR>Now i present a list of every order, selecting only orderhead rows (..where type = &#039;H&#039;).<BR>If the Orderhead is COMPLETE i present it to the user as normal, however if the orderhead row should have a status<BR>of "INCOMPLETE" i present this to the user in RED with an error message to correct the order.<BR><BR>This works fine, but, if only one order row (item) is incomplete (as in above example) the status of the whole<BR>order (head) will be COMPLETE. This should somehow be noted to the user.<BR><BR>Is there a way in PL-SQL to, when selecting every order head, also checking if any ascociated orderrow has any incomplete<BR>status, and if so, return a certain value?<BR><BR>I know i can do this in code but preferably i want this checked in the sql query.<BR><BR>Thanks.<BR>Anders