Showing posts with label columns. Show all posts
Showing posts with label columns. Show all posts

Monday, March 26, 2012

Problem with SQL query

Hi All,
I have the following table suppliers and product.
The Supplier table have two columns Supplier_id and Supplier_name.
Below is my data in the supplier table:
Supplier_Id
Supplier_Name
2
New Orleans Cajun Delights
3
Grandma Kelly's homestead
16
Bigfoot Breweries
19
New England Seafood Cannery
5
New Mexico Seafood
4
Indian Spices
My Products table have 3 columns Product_id, Product_name and supplier_id
I have the following data in my products table:
Product_Id
Product_Name
Supplier_Id
4
Chef Anton's Cajun Seasoning
2
5
Chef Anton's Gumbo Mix
2
65
Louisiana Fiery Hot Pepper Sauce
2
66
Louisiana Hot Spice Okra
2
6
Grandma's Boysenberry Spread
3
7
Uncle Bob's Organic Dried Pears
3
8
Northwood's canaberry sauce
3
34
Sasquach Ale
16
35
Steeleye Stout
16
67
Laughing Lumberjack Lager
16
40
Boston Crab Meat
19
41
Jack's New England Clam Chowder
19
75
Chicago Pizza
NULL
22
Indian Hot Sauce
NULL
I want to find the supplier_name of the supplier who is supplying maximum
products.
Can anybody help me with the query?
Thanks,
VinitaWhy not got for the top 5-- though you can for the top 1.
SELECT top 5 supplier_name, count(*)
FROM suppliers,
product
WHERE suppliers.supplier_id = product.supplier_id
group by supplier_name
order by count(*) DESC
****************************************
***************************
Andy S.
MCSE NT/2000, MCDBA SQL 7/2000
andymcdba1@.NOMORESPAM.yahoo.com
Please remove NOMORESPAM before replying.
Always keep your antivirus and Microsoft software
up to date with the latest definitions and product updates.
Be suspicious of every email attachment, I will never send
or post anything other than the text of a http:// link nor
post the link directly to a file for downloading.
This posting is provided "as is" with no warranties
and confers no rights.
****************************************
***************************
"Vinita Sharma" <sharmavi@.mail.armstrong.edu> wrote in message
news:OnhH2Oo6DHA.1636@.TK2MSFTNGP12.phx.gbl...
quote:

> Hi All,
> I have the following table suppliers and product.
> The Supplier table have two columns Supplier_id and Supplier_name.
> Below is my data in the supplier table:
>
> Supplier_Id
> Supplier_Name
> 2
> New Orleans Cajun Delights
> 3
> Grandma Kelly's homestead
> 16
> Bigfoot Breweries
> 19
> New England Seafood Cannery
> 5
> New Mexico Seafood
> 4
> Indian Spices
>
>
> My Products table have 3 columns Product_id, Product_name and supplier_id
> I have the following data in my products table:
>
> Product_Id
> Product_Name
> Supplier_Id
> 4
> Chef Anton's Cajun Seasoning
> 2
> 5
> Chef Anton's Gumbo Mix
> 2
> 65
> Louisiana Fiery Hot Pepper Sauce
> 2
> 66
> Louisiana Hot Spice Okra
> 2
> 6
> Grandma's Boysenberry Spread
> 3
> 7
> Uncle Bob's Organic Dried Pears
> 3
> 8
> Northwood's canaberry sauce
> 3
> 34
> Sasquach Ale
> 16
> 35
> Steeleye Stout
> 16
> 67
> Laughing Lumberjack Lager
> 16
> 40
> Boston Crab Meat
> 19
> 41
> Jack's New England Clam Chowder
> 19
> 75
> Chicago Pizza
> NULL
> 22
> Indian Hot Sauce
> NULL
>
>
> I want to find the supplier_name of the supplier who is supplying maximum
> products.
> Can anybody help me with the query?
> Thanks,
> Vinita
>
|||Thanks a zillion.
It worked
"Andy Svendsen" <andymcdba1@.NOMORESPAM.yahoo.com> wrote in message
news:uin4tno6DHA.2496@.TK2MSFTNGP09.phx.gbl...
> Why not got for the top 5-- though you can for the top 1.
> SELECT top 5 supplier_name, count(*)
> FROM suppliers,
> product
> WHERE suppliers.supplier_id = product.supplier_id
> group by supplier_name
> order by count(*) DESC
> --
> ****************************************
***************************
> Andy S.
> MCSE NT/2000, MCDBA SQL 7/2000
> andymcdba1@.NOMORESPAM.yahoo.com
> Please remove NOMORESPAM before replying.
> Always keep your antivirus and Microsoft software
> up to date with the latest definitions and product updates.
> Be suspicious of every email attachment, I will never send
> or post anything other than the text of a http:// link nor
> post the link directly to a file for downloading.
> This posting is provided "as is" with no warranties
> and confers no rights.
> ****************************************
***************************
> "Vinita Sharma" <sharmavi@.mail.armstrong.edu> wrote in message
> news:OnhH2Oo6DHA.1636@.TK2MSFTNGP12.phx.gbl...
supplier_id
maximum
>

Monday, March 12, 2012

Problem with SCD connecting to Oracle

Hello Everyone,

I’m getting a problem in SCD connecting to oracle DB.

I had set the OLE DB Input Output Properties Tab

And mapped the columns in Column Mappings Tab

Every thing is taken care according to Type 2 load

But every time I run the job its inserting the records rather than updating it or ignoring if not find any new or changed records from source.

Can any one help me in sorting this issue.

Please.

From the SCD Component there are three out put links one is Inferred Member Updates Output (connecting to an OLE DB which is updating the target table based on business key), New Output (connected to union all component), &

Historical Attribute Inserts Output (connected to derived column component, OLE DB and union all component)

the problem is in next run the SCD is sending the input records to Historical Attribute Inserts Output pipeline and that is sending the data to destination which in turns inserting the data into target table.

can any one help me in resolving the issue.

this is very critical for my project and I’m not able to resolve it by any ways i had tired out.

my destination table is oracle

Friday, March 9, 2012

problem with reportviewer columns

How do I resize the columns in reportviewer?

At the moment my report wich has 7 columns displays each column as about half a cm width.

have tried the various properties with out success

I use firefox as my browser, once I installed the extension IETab and told firefox to always use the IETab when

opening my site then the report displayed properly. Apparently MS are aware of this problem with firefox and

have a fix in the next asp.net sp.