Jump to content

Who's good at SQL? Your chance to shine.


revolution saint
 Share

Recommended Posts

Will probably need a little bit more info, to be fair! :lol:

 

Something along the lines of:

 

SELECT t1.col_1, t1.col_2, SUM(t2.col_3)

FROM tab_1 t1, tab_2 t2, tab_3 t3

WHERE t1.col_1 = t2.col_1

AND t2.col_1 = t3.col_1 (+)

ORDER BY t1.col_1 NULLS LAST;

 

The (+) command allows null results to be returned in the table join between t2 and t3 in that example.

Link to comment
Share on other sites

Will probably need a little bit more info, to be fair! :lol:

 

Something along the lines of:

 

SELECT t1.col_1, t1.col_2, SUM(t2.col_3)

FROM tab_1 t1, tab_2 t2, tab_3 t3

WHERE t1.col_1 = t2.col_1

AND t2.col_1 = t3.col_1 (+)

ORDER BY t1.col_1 NULLS LAST;

 

The (+) command allows null results to be returned in the table join between t2 and t3 in that example.

 

Cheers, you have a PM Steve.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...