picking up a single record from merge table, if it has duplicate entries
"Ilavajuthy Palanisamy" <[email protected]>
| Newsgroups | gmane.comp.db.mysql.windows |
|---|---|
| Message-ID | <52BBA75459915749B68F93B604B636CD0129A5AA@neptune.TidalNetworks.net> |
Hi, Currently we have multiple MYISAM tables, we create merge table out of these multiple tables to retrieve data. Now we have same record available in multiple tables, data retrieved from merge table produces duplicate records. But what we need is to get only one record out of these multiple records based on some condition. For e.g. Table1 has Rec1 Rec2 Rec3 Table2 has Rec4 Rec5 Rec1 Now the data retrieved from merge table produces Rec1 Rec2 Rec3 Rec4 Rec5 Rec1 But we need one instance of record Rec1. The selection of this record is based on the query, some times it is based on the max bandwidth (bandwidth is a field), some time based on distinct. Is there a SQL query, which will resolve my requirement? Thanks in advance. Ila.