jaikar Posted June 7, 2007 Share Posted June 7, 2007 HI friends this is something about the MySql, is it possible to write a query to compare records in 2 tables, like if the number of records in the 2 tables are equal the query should return 1 if not equal the query should return 0. this can also be done in php like, get the number of records from one table and get number of records in another table, compare it and do the operation. but i wanted to know if its possible to do the compare records using the query itself. for example, if one table has 5 records, this should be compared with another table, if this table has 5 records, then the result of the query should be 1 else 0. if i use joints, it will return all the 5 records. so not sure how to make this in a query. anyone have any idea ? Thanks in advance. Jaikar Quote Link to comment https://forums.phpfreaks.com/topic/54582-compare-records/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.