Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

load records from as400 to webpage

Status
Not open for further replies.

jadec

MIS
Jan 22, 2004
87
US
Hi Everyone,
I want load a list of records from as400 to webpage, But I want load only one record if there are mutiple records have the same key. I used distinct but the result is not what i want. because I selected two fields, one is that key field and another is the description. I got mutiple records with same key field and different description. But I want only one record for that key field, I don't care if the description same or not. The sql statement is listed below:

qry="select distinct keyfield, description from lib.masterfile where keyfield like '"&1234&"%'"

I got 2 records which key = 1234 :

Key Description
---- ---------------
1234 new car
1234 new 2004 car

I only want to display one 1234.

So anyone know how to do that.

Thanks
 
Add the clause, FETCH FIRST ROW ONLY.


"When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for here you have been, and there you will always long to return."

--Leonardo da Vinci

 
Sorry flapeyre, can you show me how? I don't get it. Thanks
 
Please do not cross post.

I just spent a few minutes giving you a example in the ASP forum while the answer was here already.

it is a SQL problem not a RPG or ASP problem.



___________________________________________________________________

The answer to your ??'s may be closer then you think.
Check out Tek-Tips knowledge bank by clicking the FAQ link at the top of the page
 
eg:
ANSI_SQL Forum forum220

___________________________________________________________________

The answer to your ??'s may be closer then you think.
Check out Tek-Tips knowledge bank by clicking the FAQ link at the top of the page
 
Thank you onpnt, for pointing me to the right place.
 
Thank you for not taking that in a rude way [thumbsup2]

___________________________________________________________________

The answer to your ??'s may be closer then you think.
Check out Tek-Tips knowledge bank by clicking the FAQ link at the top of the page
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top