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
901

can any one please tell me the exact difference between select * and select single

what difference will appear in the output.

8 REPLIES 8
Read only

Former Member
0 Likes
867

Hi,

Select * will select all the records which satisfy the where condition clause,

But in Select Single it will select only the single first entry in the DB table which satisfy the where condition clause.

Regards,

Ranjit Thakur.

<b>Please Mark The Helpful Answer.</b>

Read only

Former Member
0 Likes
867

Hi Hemaltha,

Selecr * will fetch all the Records from the table for the given <b>where condition</b>,

Select Single will fetch only one Record from the table for the given <b>where condition,</b>

Read only

Former Member
0 Likes
867

hi..

<b>select *</b> will fetch all the records according to the where condition

<b>select single</b> will fetch only the single record

according to the where condition

Thanks

Ashu

Read only

Former Member
0 Likes
867

Hi,

SELECT SINGLE is an option we use only when we know the full key of the table, not when we know that there will be only one record. So if you are selecting from MARA and your WHERE condition has MATNR in it, then you should use SELECT SINGLE. But if your WHERE condition has BISMT(old material number) and even if you know that it will result in one record only, you should not use SELECT SINGLE. It is not that it will give you an error but if you do an extended check, there it will show it as a warning saying that you didn't use the full key and that there is a possibility that there could be more than one record.

Select * -


selects all fields from the database table.

Regards,

Priyanka.

Read only

S0025444845
Active Participant
0 Likes
867

hi,

select * will fetch all the records from database table .( data for all rows and all coumns for a particular row)

select single will fetch only one row ( mean to say all coums for that particular row only)

regards,

sudha

Read only

Former Member
0 Likes
867

<b>SELECT *</b> for selecting all fields of table rows which meets the condition in WHERE clause.

For e.g

<b>SELECT vblen</b> for selecting only VBELN field of table rows which meets the condition in WHERE clause

<b>SELECT SINGLE</b> for selecting only 1 row even if the more rows are available for condition in WHERE clause. Mostly we should specify all primary key fields in WHERE for SELECT SINGLE.

Reward if its useful

Regards,

Sail

Read only

Former Member
0 Likes
867

hi hemalatha,

the difference is

if u write

select * from mara where ernam='rudisill'.

this will return all rows with ernam with the value rudisill.......

if u write

select single * from mara where ernam='rudisill'.

it will return only one row ...

based on your requirement u can use the select statement ....in some case u may want one one row to be returned in that case u can use (select single statement)

reward if usefull..........

Read only

Former Member