Hai

sql server India
  • 14 years ago

    A.customer table :
    customerid customername
      1                  kala
      2                  mala
      3                 bala

    B.Vendor Table:
    vendorid   vendorname
       1              HP Shop
       2              BP shop
       3              ll shop

    C.Product table:
    productid  productname
      1                  box
      2                  pencils
      3                  TV
      4                  Glass
    D.stock Table
    stockid vendorid  customerid productid          qty
      1             1               null             1                      34
      2           null            null              2                      89
      3           null               2               3                     100
      4           3                null               4                      90

    my table structure over.now i want to display the these fields:
    vendorname,customername, productname ,qty in single query
    at the same time is there vendorid or customerid thenshow the vendorname and customername
    other wise show the null values in the vendor name,customer name field

    please send the query































Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.” - Antoine de Saint Exupéry