BookmarkSubscribeRSS Feed
HeatherNewton
Quartz | Level 8

is distinct in proc sql same usage as distinct of SQL?

 

in SQL,

eg select distinct apple orange banana from fruits

mean each row consist of apple orange banana is distinct..

 

in SAS,

proc sql distinct apple orange banana from fruits...

 

is the meaning of distinct the same in both cases? 

 

2 REPLIES 2
AMSAS
SAS Super FREQ

I'm not sure your definition of DISTINCT is the same as my definition, based on your example

 

Here's the link to the documentation 
Select Clause, DISTINCT Argument 

ballardw
Super User

@HeatherNewton wrote:

is distinct in proc sql same usage as distinct of SQL?

 

in SQL,

eg select distinct apple orange banana from fruits

mean each row consist of apple orange banana is distinct..

 

in SAS,

proc sql distinct apple orange banana from fruits...

 

is the meaning of distinct the same in both cases? 

 


Whose "SQL" in the first example. Some implementations of SQL may do things differently based on the rest of the query such as Where, Having or Group by clause and the exact options used in those as well.

 

Many flavors of SQL have extensions to the 'standard' behavior and may be controlled by user settings in addition to the code shown.

 

Better would be to provide some example data AND complete query examples. Best would be create data in the two, or more systems, that is identical and actually run the query and observe the result.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 467 views
  • 0 likes
  • 3 in conversation