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
1,046

Hi all,

I need to select data from a customized table.

for example the record in the customized table would look like this


machine     data1     data2     data3
A100001     SA1       SA2       SA3
A100002     SA4       SA5       SA6
B100001     SA7       SA8       SA9
C100001     SA1       SA2       SA3
B100001     SA4       SA5       SA6

How could the select statement to only select for only machine prefix is with "A". My expected data selected is


machine     data1     data2     data3
A100001     SA1       SA2       SA3
A100002     SA4       SA5       SA6

Thanks to all.

1 ACCEPTED SOLUTION
Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
975

Hi

Use SORT TABLE BY MACHINE.

SELECT *

FROM table

INTO itab

WHERE machine = 'A%'.

Regards,

Sreeram

8 REPLIES 8
Read only

Former Member
0 Likes
975

Hello

Yes. Try like this:


select * from ztable where machine LIKE 'A%'.

Read only

Former Member
0 Likes
975

give

machine like 'A%'

or try

machine = 'A%'

in your where clause of select query.

Read only

sridhar_meesala
Active Contributor
0 Likes
975

Hi,

Use the % operator with the SELECT statement.

SELECT * 
FROM table 
INTO itab 
WHERE machine = 'A%'.

Thanks,

Sri.

Read only

Former Member
0 Likes
975

Hello frn.

use like statement in where clause with select statement ...

select * from <database table name > where f1 like '%A' .

and Please try F1 on LIKE staement .... you will get solution .

Thanks ..Priyank

Read only

Former Member
0 Likes
975

hI,

You can try the following code.



SELECT * 
FROM IT_TAB 
INTO IT_TEMP
WHERE machine like 'A%'. 

Regards,

Vik

Edited by: vikred on Jul 23, 2009 7:14 AM

Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
976

Hi

Use SORT TABLE BY MACHINE.

SELECT *

FROM table

INTO itab

WHERE machine = 'A%'.

Regards,

Sreeram

Read only

Former Member
0 Likes
975

Hi,



select * from zdbtable into table it_tab where machine LIKE 'A%'.

Read only

Former Member
0 Likes
975

Hi,

SELECT machine

data1

data2

data3

FROM Ztable

INTO table ITAB

WHERE machine Like 'A%'.

Regards,

ShreeMohan