Fill in missing values in a SELECT statement

Posted by benjamin button on Stack Overflow See other posts from Stack Overflow or by benjamin button
Published on 2010-04-29T14:16:36Z Indexed on 2010/05/04 9:38 UTC
Read the original article Hit count: 179

Filed under:
|
|
|

If i have a table with two fields.customer id and order. let's say i have in total order ID 1,2,3,4

all the customer can have all the four orders.like below

    1234 1
    1234 2
    1234 3
    1234 4
    3245 3
    3245 4
    5436 2
    5436 4

you can see above that 3245 customer doesnt have order id 1 and 2. how could i print in the query output like

3245 1
3245 2
5436 1
5436 3

EDIT: i dont have order table but i have list of order's like we can hard code it in the query(1,2,3,4) i dont have an orders table.

© Stack Overflow or respective owner

Related posts about sql

Related posts about Oracle