Link to home
Start Free TrialLog in
Avatar of RadhaKrishnaKiJaya
RadhaKrishnaKiJaya

asked on

Need help with a Query

Hi Experts,

I have the following data.

 ID         VendorID      ManufacturerPartNo      ManuID      PartCost         PreferredVendor
4344      4            1492-EAJ35                    17             108       
4345      36            1492-EAJ35                    17             108.11       
4346      5            1492-EAJ35                    17             110                    Y
4347      25            1492-EAJ35                    17              0       
4348      21            1492-EAJ35                    17              0       
4349      7            1492-EAJ35                    17              0       

I want the record with PreferredVendor is "Y" first then all other records ordered by PartCost

 ID         VendorID      ManufacturerPartNo      ManuID      PartCost         PreferredVendor
4346      5            1492-EAJ35                    17             110                    Y
4347      25            1492-EAJ35                    17              0       
4348      21            1492-EAJ35                    17              0       
4349      7            1492-EAJ35                    17              0
4344      4            1492-EAJ35                    17             108       
4345      36            1492-EAJ35                    17             108.11

Is it possible to get this output with a query.

Thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of Russ Suter
Russ Suter

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Probably something like...

SELECT * FROM MyTable WHERE ManufacturerPartNo = somevalue ORDER BY PreferredVendor DESC
Avatar of RadhaKrishnaKiJaya
RadhaKrishnaKiJaya

ASKER

Thank you very much. It worked!!