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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you very much. It worked!!
SELECT * FROM MyTable WHERE ManufacturerPartNo = somevalue ORDER BY PreferredVendor DESC