Using answer as criteria in sql server

5 pts.
Tags:
SQL
SQL Server
I have a table that has a demand order and a supply order I want to search for a order in the demand order column it may have more than one supply order and then I want it to look to see if that/those supply order is in the demand column and if it is get the supply orders and so on. So essentially I want to see a list of demand orders.

Answer Wiki

Thanks. We'll let you know when a new response is added.

SELECT demand_order,supply_order FROM table_name WHERE demand_order = order#;

table_name is the table
demand_order is the name for the demand order column
supply_order is the name for the supply order column
order# is the order you want.

You can use the same statement for supply orders too.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • carlosdl
    Maybe you can show some example data, and the desired result of the query, in order to be sure your question is understood.
    70,220 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following