We help IT Professionals succeed at work.

Remove row based on value that gets returned

Last Modified: 2013-11-05
Hi I was wondering how I would be able to remove the row if percentage = null or 0
this is what im getting back.

Alice Mutton      NULL
Chef Anton's Gumbo Mix      NULL
Gorgonzola Telino      NULL
Perth Pasties      NULL
Thüringer Rostbratwurst      NULL
Boston Crab Meat      0
Camembert Pierrot      0
Carnarvon Tigers      0
Chai      0
Chartreuse verte      0
Chef Anton's Cajun Seasoning      0
Côte de Blaye      0
Escargots de Bourgogne      0
Filo Mix      0
Flotemysost      0
Geitost      0
Genen Shouyu      0
Grandma's Boysenberry Spread      0
Guaraná Fantástica      0
Gudbrandsdalsost      0
Gula Malacca      0
Gumbär Gummibärchen      0
Gustaf's Knäckebröd      0
Ikura      0
Inlagd Sill      0
Jack's New England Clam Chowder      0
Konbu      0
Lakkalikööri      0
Laughing Lumberjack Lager      0
Louisiana Fiery Hot Pepper Sauce      0
Manjimup Dried Apples      0
Mishi Kobe Niku      0
Mozzarella di Giovanni      0
Nord-Ost Matjeshering      0
Northwoods Cranberry Sauce      0
NuNuCa Nuß-Nougat-Creme      0
Original Frankfurter grüne Soße      0
Pâté chinois      0
Pavlova      0
Queso Manchego La Pastora      0
Raclette Courdavault      0
Ravioli Angelo      0
Rhönbräu Klosterbier      0
Röd Kaviar      0
Rössle Sauerkraut      0
Sasquatch Ale      0
Schoggi Schokolade      0
Singaporean Hokkien Fried Mee      0
Sir Rodney's Marmalade      0
Sirop d'érable      0
Spegesild      0
Steeleye Stout      0
Tarte au sucre      0
Teatime Chocolate Biscuits      0
Tofu      0
Tourtière      0
Tunnbröd      0
Uncle Bob's Organic Dried Pears      0
Valkoinen suklaa      0
Vegie-spread      0
Zaanse koeken      0
Gnocchi di nonna Alice      47
Ipoh Coffee      58
Outback Lager      66
Queso Cabrales      136
Scottish Longbreads      166
Chang      235
Wimmers gute Semmelknödel      363
Mascarpone Fabioli      444
Gravad lax      454
Chocolade      466
Longlife Tofu      500
Aniseed Syrup      538
Maxilaku      600
Sir Rodney's Scones      1333
Rogede sild      1400
Louisiana Hot Spiced Okra      2500

select distinct productname, (100 * unitsonorder)/unitsinstock as percentage
from products
where unitsinstock is not null and unitsonorder is not null 
order by percentage asc

Open in new window

Watch Question

Database Consultant
Top Expert 2009
This one is on us!
(Get your first solution completely free - no credit card required)
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.