Jump to content

select three diferent fields related to a common field


Recommended Posts

hello!

 

i'm implementing an e-commerce system to distribute key codes.

 

right now i'm thinking of a sql syntax to do the following:

 

i have a table: orders

 

here i have the orders_id field (unique for each order placed)

 

with this orders_id field there may be more than one products ordered therefore in the products_id field i can have the following situation:

 

orders_id: 101

products_id: 13

orders_id: 101

products_id: 43

orders_id: 101

products_id: 1

 

so i have three rows with the same orders_id but different products_id

 

now i want to grab the value of these products_id for the specified orders_id (p.s. i can provide the orders_id value already)

 

any ideas? i'm a little stuck on this..

 

thanks

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.