Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Eagle_f90
Constraint Violating Yak Guru
424 Posts |
Posted - 2003-01-06 : 23:01:22
|
| Is there way to join 3 tables so I can easiy compaire info between all 3 of them.--For those with wings, fly to your dreamsIt is all or nothing there is no in-betweenRemember who I was... For me |
|
|
harshal_in
Aged Yak Warrior
633 Posts |
Posted - 2003-01-06 : 23:45:16
|
quote: Is there way to join 3 tables so I can easiy compaire info between all 3 of them.--For those with wings, fly to your dreamsIt is all or nothing there is no in-betweenRemember who I was... For me
Yes u can very well join three tables provided they have proper relationships defined between them.Expect the UnExpected |
 |
|
|
Eagle_f90
Constraint Violating Yak Guru
424 Posts |
Posted - 2003-01-06 : 23:49:40
|
| Well I can realate each to on of the tables but one does not have anything in comman with another. Can it still be done?--For those with wings, fly to your dreamsIt is all or nothing there is no in-betweenRemember who I was... For me |
 |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2003-01-07 : 00:05:44
|
| We are not psychic. Can you post some table definitions and data so we know what you are trying to do ?Damian |
 |
|
|
Eagle_f90
Constraint Violating Yak Guru
424 Posts |
Posted - 2003-01-07 : 00:11:03
|
| Sorry, Ok I have 3 tables. Knownmoves, moves, and stats. The table knownmoves has 3 coulmns "movename" "level" and "playerid". moves has tables "movename" "level" "st" "def" "life" "agil" "ki" and table stats has "playerid" "st" "def" "life" "agil" and "ki"What I am tying to do is write an ASP script taht looks at knownmoves to see if they know a move in the moves table. and if there is something in moves they don't know it then looks at stats to see if the meet the stats requirements to learn it.Hope that is not too confusing.--For those with wings, fly to your dreamsIt is all or nothing there is no in-betweenRemember who I was... For me |
 |
|
|
mr_mist
Grunnio
1870 Posts |
Posted - 2003-01-07 : 08:34:59
|
quote: Sorry, Ok I have 3 tables. Knownmoves, moves, and stats. The table knownmoves has 3 coulmns "movename" "level" and "playerid". moves has tables "movename" "level" "st" "def" "life" "agil" "ki" and table stats has "playerid" "st" "def" "life" "agil" and "ki"What I am tying to do is write an ASP script taht looks at knownmoves to see if they know a move in the moves table. and if there is something in moves they don't know it then looks at stats to see if the meet the stats requirements to learn it.
This assumes that you are applying things retroactively, if you are cheking every time a player changes any stat you can probably change the => signs to =I'm also unsure where level comes into play.SELECT movename FROM movesinner join stats onstats.st => moves.st andstats.def => moves.def andstats.life => moves.life andstats.agil => moves.agil andstats.ki => moves.ki -- <-- all the moves a player can learnleft outer join knownmoves km onstats.playerid = km.playerid andnoves.movename = km.movenamewhere km.movename is nulland stats.playerid = @theplayeridyouwant-------Moo. |
 |
|
|
|
|
|
|
|