• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sql-statement in tuple

 
nimo frey
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which sql-statement should I prefer?



or this:



Is the one faster than the other?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the first one valid SQL?
 
nimo frey
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess yes, I use DB2 and the first one also works.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It must be DB2 syntax then, its not part of the ANSI standard, and a quick test shows Oracle, MySQL and SQL Server don't support it. This would be reason enough for me to decide not to use it. I'm afraid I can't help with your performance question, DB2 is a bit of a mystery to me. What does the documentation say?
 
Fatih Keles
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most rdbms has a explain execution plan utility for system and sql optimization. I have no familiarity with DB2 but a little google search (DB2 explain plan) leads to this : http://etutorials.org/SQL/Sql+tuning/Chapter+3.+Viewing+and+Interpreting+Execution+Plans/3.2+Reading+DB2+Execution+Plans/

You can use these tools to verify and see what database does for your query.

Regards,

Fatih.
 
nimo frey
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
okay thanks, I use the non-tuple version.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic