You need to do a join. SELECT table1.ID AS PL_NAME, table1.ID AS PC_NAME, table1.ID AS PA_NAME FROM table1, table2 WHERE (table2.PL = table1.ID) AND (table2.PC = table1.ID) and (table2.PA = table1.ID) ;
Or something like that. Sorry I couldn't be of more help. Respectfully, Ligaya Turmelle "Tariq Murtaza" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > We have two tables > > Table1: > ------------------------- > ID | Name > ------------------------ > 1 | name1 > 2 | name2 > 3 | name3 > 4 | name4 > > > Table2: > -------------------------------------------------------------------------- ------------------------- > PL | PC | PA | Description > -------------------------------------------------------------------------- ------------------------- > 1 | 2 | 4 | Some description > for Project 1 > 2 | 3 | 1 | Some description > for Project 2 > 1 | 2 | 4 | Some description > for Project 3 > 4 | 1 | 3 | Some description > for Project 4 > 3 | 1 | 4 | Some description > for Project 5 > 2 | 3 | 1 | Some description > for Project 6 > > > I need the output like.......... > > -------------------------------------------------------------------------- ------- > PL-Name | PC-Name | PA-Name > -------------------------------------------------------------------------- ------- > name1 | name2 | name4 > name2 | name3 | name1 > name1 | name2 | name4 > name4 | name1 | name3 > name3 | name1 | name4 > name2 | name3 | name1 > > > Please guide me how can i achieve this kind of result set. > Regards, > > Tariq > > > > > > > > > > > > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php