aika Posted July 25, 2009 Report Share Posted July 25, 2009 Neesmu īsti pārliecināts vai tas vispār ir iespējams: atlasīt datus no 1 tabulas pievienojot datus no 2trās (pat ja attiecīga rinda tajā neksistē) respektīvi: Tabula 1: keys; vērtība a 1 b 2 c 3 Tabula 2: keys; vērtība a 4 c 5 Atgriezt: a 1 4 b 2 c 3 5 Quote Link to comment Share on other sites More sharing options...
Wuu Posted July 25, 2009 Report Share Posted July 25, 2009 http://web-dev.lv/2009/04/sql-rokasgramata-2-dala-join/ Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted July 25, 2009 Report Share Posted July 25, 2009 Ir iespējams: SELECT t1.keys, t1.vertiba, t2.vertiba FROM tabula1 AS t1 LEFT JOIN tabula2 AS t2 ON t1.keys = t2.keys Tajā gadījumā, kad tabulā2 nebūs šāda keya, trešā kolonnaa saturēs NULL Quote Link to comment Share on other sites More sharing options...
aika Posted July 26, 2009 Author Report Share Posted July 26, 2009 Ir iespējams: SELECT t1.keys, t1.vertiba, t2.vertiba FROM tabula1 AS t1 LEFT JOIN tabula2 AS t2 ON t1.keys = t2.keys Tajā gadījumā, kad tabulā2 nebūs šāda keya, trešā kolonnaa saturēs NULL NU jā, tā strādā! Es jau nebūtu prasījis, ja nebūtu pirms tam pats mēģinājis. Vnk sintakse nebija pareiza. Paldies! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.