I just joined this community and inspired by roaming in it. However, I would like to discuss a problem - I'm having.

I'm developing an application for property management. I've a table with some general columns as well as some specific. For example;

General: [Buy OR Sell] , [Plot no.] , [City]
Specific: [Phase] , [Block] , [Measuring]

Specific fields mean, some property have them and some don't. For example; property 1 has PHASE and BLOCK. While property 2 has only Measuring.

Now, I wanna make a page where all entries for BUY properties - that match with SELL properties, should be listed.

I don't wanna use DISTINCT function of SQL because BUY property may have blank field.

I know, I gonna have an answer for my question by Dani Pros. Thanks in advance.

Are buyers going to be 'searching' for properties by entering criteria? Then you want to return the properties for sale that match that criteria?

No, its application for Property Agency. So people will come who are in need of property and they will insert BUY property in database. So there will be a page where all the matches of SELL and BUY property will be displayed.

Finally I completed application. Actually whatever I wanted was many-to-many relationship which is not possible in real world. So I changed it in one-to-many relationship.

What I did is when we insert a property for BUY purpose, I use all POST Variables in SESSION Variables and when Thank You page comes I used all the SESSION Variables to generate a QUERY for searching all the matching records and PULL them out from a database.