I write code in java , i can write sql query in 2 conditions , but short sql query is very diffucult for java . what is the difference between short sql query and long sql query ? they print same results. Which code Should i use ?
Welcome to the ranch! As far as I know, length of a sql statement doesn't affect query performance by itself. Performance depends upon factors like proper indexing of tables, quality of this query optimizer and so on.
I'm not too sure what you mean by "short sql query is very difficult for java".
The way to compare the efficiency of two queries is to use the database tools (eg EXPLAIN PLAN in Oracle) which allow you to see the plan that has been generated for the query.
This takes some experience, though.