BookmarkSubscribeRSS Feed
deleted_user
Not applicable
What is the equivalent of "top n" within SAS? I'm having trouble with defining the statement pasted below:

SELECT A.COLUMN1, A.COLUMN2, A.COLUMN3,
(SELECT TOP 1 B.COLUM4 FROM TABLE_B AS B
WHERE A.COLUMN1 = SUBSTR(B.COLUMN1,1,17)) AS XX
FROM TABLE_A AS A

Your help would be much appreciated.
1 REPLY 1
deleted_user
Not applicable
I'm sorry, I think I posted this one within the wrong subforum.
Admin can delete this thread, I posted a new one in the right section.

Thank you.

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore Now →
Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1122 views
  • 0 likes
  • 1 in conversation