cgchris99 Posted August 17, 2007 Share Posted August 17, 2007 I need to verify some children records to a parent record I need to do a select in my detail file will call DetA to see if there is NOT a match if HeaderA I only want the detail records that do not have a Header. Does this make sense? How can I do this? I am trying to get this info so I can delete the child records that don't have a matching parent. Thanks Link to comment https://forums.phpfreaks.com/topic/65348-how-do-i-do-this-sql-select-statement/ Share on other sites More sharing options...
btherl Posted August 17, 2007 Share Posted August 17, 2007 To match records that do not exist in another table: SELECT * FROM tableA LEFT JOIN tableB ON (tableA.joincol = tableB.joincol) WHERE tableB.joincol IS NULL Link to comment https://forums.phpfreaks.com/topic/65348-how-do-i-do-this-sql-select-statement/#findComment-326400 Share on other sites More sharing options...
cgchris99 Posted August 17, 2007 Author Share Posted August 17, 2007 Thanks, I'll give that a try. Link to comment https://forums.phpfreaks.com/topic/65348-how-do-i-do-this-sql-select-statement/#findComment-326698 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.