how to create a new table which contains the field as other table's data.

  • I have a query related to database, I have explained it in detail below:

    I have one table companymaster which contains companycode (primary key) and companyname as their field. There are three entry as per below. 1,abc-2,xyz-3,qpr. another table which contains productcode(primary key), company code(reference of companycode) and product name. in which there are some entries like 1,1,mnp-2,1,jnp and 3,1,rst.

    I want a query which can create a new table having name as abc and files as mnp,jnp,rst at run time. Please help.

  • try joining the two tables on the field companycode.

    Please post table definitions, sample data and desired output. Read this to see the best way to post this to get quick responses.

    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    Tanx 😀

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply