• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Subquery or Join

#1
Hello
I have 2 table that have relation both
I try to get result from table 2 with 2 way:
1: select table1.name,table2.score from table2 join table1 on table1.username = table2.username
2: select (select name from table1 where table1.username = table2.username) as name,score from table2

Now
Which way is good?

Note: i need name field only in table1
Reply


Messages In This Thread
Subquery or Join - by omid_student - 09-27-2017, 06:27 AM
RE: Subquery or Join - by rtenny - 09-27-2017, 08:42 AM
RE: Subquery or Join - by omid_student - 09-27-2017, 08:48 AM
RE: Subquery or Join - by dave friend - 09-27-2017, 01:48 PM
RE: Subquery or Join - by omid_student - 09-28-2017, 11:31 AM
RE: Subquery or Join - by dave friend - 09-28-2017, 12:11 PM
RE: Subquery or Join - by rtenny - 09-29-2017, 07:08 AM
RE: Subquery or Join - by ciadvantage - 09-29-2017, 08:05 AM
RE: Subquery or Join - by omid_student - 09-29-2017, 12:52 PM
RE: Subquery or Join - by php_rocs - 09-29-2017, 04:00 PM
RE: Subquery or Join - by omid_student - 09-30-2017, 11:19 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.