Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

select statement

Former Member
0 Likes
544

hi to all,

select single *

select to up to n rows

in the above statements which is better in performance.and pls let me know in which constraints tht we can use above statements.

thanx and regards,

loki

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
529

select single *: This helps you to select 1 record....

select to up to n rows: This helps you to select 'n' records,

Depending upon your requirement, you use them ....

Regards,

Pavan

5 REPLIES 5
Read only

Former Member
0 Likes
529

well you can NOT compare those two.

Select single will get you ONE record only ALWAYS.

while select up to n rown will get you n records if there are enough. otherwise, if there are less than n records it will give you all.

Read only

Former Member
0 Likes
529

Hi Lok

If u know the complete key in where codition use select single

if u dont use upto n rows ( if u have part of key in where condition )

select single is best when u r specifing all key fields in where condition

reward points to all helpful answers

kiran.M

Read only

Former Member
0 Likes
529

HI

SELECT SINGLE IS THE BETTER IN THE PERFORMANCE POINT OF VIEW

SELECT SINGLE ;- IF THERE 100 ENTRIES IN T HAT THERE ONLY ONE CORRESPONDING ELEMENT FOR UR REQ THEN

THIS QUERY WILL SEARCH FOR SINGLE ENTRY HIT AS EARLY AS POSSIBLE IT HITS THAT RECORD IT WILL GIVE OUT PUT

SELECT UP TO N ROWS ;-IT WILL GET THE VALUES UP TO N ROW S

PERFORMANCE POINT OF VIEW SELECT SINGLE IS THE BETTER THAN SELECT UP TO

REWARD IF USEFULL

Read only

Former Member
0 Likes
530

select single *: This helps you to select 1 record....

select to up to n rows: This helps you to select 'n' records,

Depending upon your requirement, you use them ....

Regards,

Pavan

Read only

former_member189059
Active Contributor