on ‎2006 Feb 09 12:06 PM
Hi ,
I have table in the following format
USERID LDATE LTIME
0000000001 2006.02.09 172005
0000000001 2006.02.09 172055
0000000001 2006.02.09 172224
I need to get the users earlier logon date & time(Only single record). I this case I have to pick up the third record ie 0000000001 2006.02.09 172224
For getting this record how we can use SELECT Single or SELECT UPTO 1 Rows.
My WHERE condition will be like this,
where userid eq lv_userid and
ldate le sy-datum and
ltime lt sy-uzeit.
I Dont want to read all the record by SELECT ENDSELECT and then validate to pickup the latest one ( Since this table will contain huge number of records).
It would be great if anyone higlight a optimized select statement.
BR,
Raj
Request clarification before answering.
Hi,
When it is returning a single record selectsingle is preferred to select . The syntax of using selectsingle is similar to select statement except it will not have endselect.Tell me if you are not able to do can give you more information.
Regards,
Sudheer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 8 | |
| 7 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.