• We should now be fully online following an overnight outage. Apologies for any inconvenience, we do not expect there to be any further issues.

SQL geniuses

bleeb

Lifer
Feb 3, 2000
10,868
0
0
What is the syntax for joining three tables??

Edit: I don't really use SQL. This is for someone else.

Edit 2: Thanks to those who responded.
 

DWW

Platinum Member
Apr 4, 2003
2,030
0
0
Depends on which database software you mean and which SQL spec.

Can you clarify a little more about what you are running?
 

DT4K

Diamond Member
Jan 21, 2002
6,944
3
81
EDIT: removed since people are getting so pissy about a little joke.
 

Armitage

Banned
Feb 23, 2001
8,086
0
0
Originally posted by: DT4K
I'm sorry, but I don't like talking about SQL with people who obviously don't have a good understanding of the subject matter.

<------SQL developer for the past 3 years.

Lol ... then WTF did you post? Just to pat yourself on the back?
 

bleeb

Lifer
Feb 3, 2000
10,868
0
0
Originally posted by: DT4K
I'm sorry, but I don't like talking about SQL with people who obviously don't have a good understanding of the subject matter.

<------SQL developer for the past 3 years.


EDIT: by the way, it doesn't take a genius to join three tables. It's not difficult at all.

Here's a cookie...way to go kiddo!
 

DT4K

Diamond Member
Jan 21, 2002
6,944
3
81
Originally posted by: Armitage
Originally posted by: DT4K
I'm sorry, but I don't like talking about SQL with people who obviously don't have a good understanding of the subject matter.

<------SQL developer for the past 3 years.

Lol ... then WTF did you post? Just to pat yourself on the back?

see my sig containing bleeb's response to one of my comments in another thread.
 

DT4K

Diamond Member
Jan 21, 2002
6,944
3
81
Originally posted by: bleeb
Originally posted by: DT4K
I'm sorry, but I don't like talking about SQL with people who obviously don't have a good understanding of the subject matter.

<------SQL developer for the past 3 years.


EDIT: by the way, it doesn't take a genius to join three tables. It's not difficult at all.

Here's a cookie...way to go kiddo!

:cookie;
 

Armitage

Banned
Feb 23, 2001
8,086
0
0
Something like this maybe?

SELECT tbl1.*, tbl2.*, tbl3.* FROM tbl1, tbl2, tbl3 WHERE tble1.key=tbl2.key AND tble1.key=tbl3.key
 

Rufio

Banned
Mar 18, 2003
4,638
0
0
Originally posted by: DT4K
I'm sorry, but I don't like talking about SQL with people who obviously don't have a good understanding of the subject matter.

<------SQL developer for the past 3 years.


EDIT: by the way, it doesn't take a genius to join three tables. It's not difficult at all.

how arrogant can you get?
 

bleeb

Lifer
Feb 3, 2000
10,868
0
0
Originally posted by: DT4K
Originally posted by: bleeb
Originally posted by: DT4K
I'm sorry, but I don't like talking about SQL with people who obviously don't have a good understanding of the subject matter.

<------SQL developer for the past 3 years.


EDIT: by the way, it doesn't take a genius to join three tables. It's not difficult at all.

Here's a cookie...way to go kiddo!

:cookie;

heheh nice... this is the first time someone put one of my quotes in their sig.
 

KEV1N

Platinum Member
Jan 15, 2000
2,932
1
0
First of all make sure that there's actually data across the three tables that you can actually correlate. It's not hard to join three tables if you can join 2.

select * from (table1 left join table2 on table1.attrib = table2.attrib) left join table3 on table1.attrib = table3.attrib
 

DT4K

Diamond Member
Jan 21, 2002
6,944
3
81
Originally posted by: Beau
Select join or union.

He doesn't want a union, he wants a join.

Depends on what kind of join you want but:

select * from tblA left join tblB
on tblA.somefield = tblB.somefield
left join tblC
on tblB.somefield = tblC.somefield

This works in MS SQL without a need for any commas or parens.
 

DT4K

Diamond Member
Jan 21, 2002
6,944
3
81
Originally posted by: Rufio
Originally posted by: DT4K
I'm sorry, but I don't like talking about SQL with people who obviously don't have a good understanding of the subject matter.

<------SQL developer for the past 3 years.


EDIT: by the way, it doesn't take a genius to join three tables. It's not difficult at all.

how arrogant can you get?

Jeez, calm the fvck down. It was a joke.
See my sig.

I made a comment in another thread disagreeing with one of bleebs statements. His response(in my sig) was basically that he was too smart and I was too dumb so he didn't want to debate the issue.

Sorry, I couldn't pass it up.
 

bleeb

Lifer
Feb 3, 2000
10,868
0
0
Originally posted by: DT4K
Originally posted by: Rufio
Originally posted by: DT4K
I'm sorry, but I don't like talking about SQL with people who obviously don't have a good understanding of the subject matter.

<------SQL developer for the past 3 years.


EDIT: by the way, it doesn't take a genius to join three tables. It's not difficult at all.

how arrogant can you get?

Jeez, calm the fvck down. It was a joke.
See my sig.

I made a comment in another thread disagreeing with one of bleebs statements. His response(in my sig) was basically that he was too smart and I was too dumb so he didn't want to debate the issue.

Sorry, I couldn't pass it up.

Actually you were being a sarcastic prick about a topic that is sensitive to some people. You still haven't told me what you know about the whole situation.
 
Jun 18, 2000
11,208
775
126
Originally posted by: bleeb
Actually you were being a sarcastic prick about a topic that is sensitive to some people. You still haven't told me what you know about the whole situation.
We're still taking about SQL, right?:confused:
 

DT4K

Diamond Member
Jan 21, 2002
6,944
3
81
Originally posted by: bleeb
Originally posted by: DT4K
Originally posted by: Rufio
Originally posted by: DT4K
I'm sorry, but I don't like talking about SQL with people who obviously don't have a good understanding of the subject matter.

<------SQL developer for the past 3 years.


EDIT: by the way, it doesn't take a genius to join three tables. It's not difficult at all.

how arrogant can you get?

Jeez, calm the fvck down. It was a joke.
See my sig.

I made a comment in another thread disagreeing with one of bleebs statements. His response(in my sig) was basically that he was too smart and I was too dumb so he didn't want to debate the issue.

Sorry, I couldn't pass it up.

Actually you were being a sarcastic prick about a topic that is sensitive to some people. You still haven't told me what you know about the whole situation.

There is a reason I try to stay away from P&amp;N.
 

DT4K

Diamond Member
Jan 21, 2002
6,944
3
81
Originally posted by: KnightBreed
Originally posted by: bleeb
Actually you were being a sarcastic prick about a topic that is sensitive to some people. You still haven't told me what you know about the whole situation.
We're still taking about SQL, right?:confused:

LOL.
I think the SQL question has been answered, so feel free to throw in your opinion on whether we can do something to combat terrorism or whether the only solution is to wait for the terrorists to realize that what they are doing isn't nice.:D
 

slycat

Diamond Member
Jul 18, 2001
5,656
0
0
can i also ask a question?
i have 2 sql2000 servers side by side. i have 1 database on one that i wanna set up replication(hot,cold,warm) for standby purposes in case the main one dies or something? someone hook me up? o yeh, i'm sql dumb :)
 

bleeb

Lifer
Feb 3, 2000
10,868
0
0
Originally posted by: DT4K
Originally posted by: KnightBreed
Originally posted by: bleeb
Actually you were being a sarcastic prick about a topic that is sensitive to some people. You still haven't told me what you know about the whole situation.
We're still taking about SQL, right?:confused:

LOL.
I think the SQL question has been answered, so feel free to throw in your opinion on whether we can do something to combat terrorism or whether the only solution is to wait for the terrorists to realize that what they are doing isn't nice.:D

I never said the only solution was to wait for terrorists... in their minds, they are doing the right thing. I just said that we can't go about killing their families to show them they are wrong. The point I was trying make was that if the U.S. did this, they would become terrorists themselves. This has certain negative ramifications, possibly increasing the support of more people for the terrorists.
 

Beau

Lifer
Jun 25, 2001
17,730
0
76
www.beauscott.com
Originally posted by: DT4K
Originally posted by: Beau
Select join or union.

He doesn't want a union, he wants a join.

Depends on what kind of join you want but:

select * from tblA left join tblB
on tblA.somefield = tblB.somefield
left join tblC
on tblB.somefield = tblC.somefield

This works in MS SQL without a need for any commas or parens.

Didn't say what exactly he needed to do either.

if he had 3 tables that store pretty much the same data, but seperated for other reasons, then a union could have been used to "join" a recordset. I questioning what had already been suggested, just adding another option. :beer:
 
Jun 18, 2000
11,208
775
126
slycat, is the second database only going to be used for backup purposes or will it need to be load balanced with active user making updates to both?

If it's the former, you can always schedule DTS tasks or something every few hours to update the backup database. Simple and reasonably reliable, but by no means an "enterprise" solution.
 

bleeb

Lifer
Feb 3, 2000
10,868
0
0
Originally posted by: Beau
Originally posted by: DT4K
Originally posted by: Beau
Select join or union.

He doesn't want a union, he wants a join.

Depends on what kind of join you want but:

select * from tblA left join tblB
on tblA.somefield = tblB.somefield
left join tblC
on tblB.somefield = tblC.somefield

This works in MS SQL without a need for any commas or parens.

Didn't say what exactly he needed to do either.

if he had 3 tables that store pretty much the same data, but seperated for other reasons, then a union could have been used to "join" a recordset. I questioning what had already been suggested, just adding another option. :beer:

Sorry guys, I can't provide more parameters for the problem. I don't really know much about SQL and my friend asks me out of the blue, 'how do you join three tables?"