📄 sqlbasic.sas
字号:
/****************************************************************/ /* S A S S A M P L E L I B R A R Y */ /* */ /* NAME: SQLBASIC */ /* TITLE: DEMONSTRATES BASIC SQL SELECT STATEMENTS */ /* PRODUCT: BASE */ /* SYSTEM: ALL */ /* KEYS: SQL SELECT WHERE LABEL AS */ /* PROCS: SQL */ /* DATA: */ /* */ /* SUPPORT: KMS, PMK UPDATE: */ /* REF: */ /* MISC: */ /* */ /****************************************************************/ title1 '*** sqlbasic: basic SQL select statements ***'; /*---------------------------------------------------------------*/ /*-- The first step is to create the Paper table which will be --*/ /*-- used in the following queries. --*/ /*---------------------------------------------------------------*/data paper; input author$1-8 section$9-16 title$17-43 @45 time time5. duration; format time time5.; label title='Paper Title'; cards;Tom Testing Automated Product Testing 9:00 35Jerry Testing Involving Users 9:50 30Nick Testing Plan to test, test to plan 10:30 20Peter Info SysArtificial Intelligence 9:30 45Paul Info SysQuery Languages 10:30 40Lewis Info SysQuery Optimisers 15:30 25Jonas Users Starting a Local User Group 14:30 35Jim Users Keeping power users happy 15:15 20Janet Users Keeping everyone informed 15:45 30Marti GraphicsMulti-dimensional graphics 16:30 35Marge GraphicsMake your own point! 15:10 35Mike GraphicsMaking do without color 15:50 15Jane GraphicsPrimary colors, use em! 16:15 25;proc sql; /*---------------------------------------------------------------*/ /*-- Let's list all of the information in the Paper table. --*/ /*---------------------------------------------------------------*/ title2 'Papers to be presented'; select * from paper; /*---------------------------------------------------------------*/ /*-- What time will the papers be finished? --*/ /*---------------------------------------------------------------*/ title2 'How long will it take?'; select author, title, time, duration, time + duration*60 as endtime from paper; /*---------------------------------------------------------------*/ /*-- Let's add some labels and formats for some clarity. --*/ /*---------------------------------------------------------------*/ select author, title, time, duration label='How Long it Takes', time + duration*60 as endtime format=time5. from paper; /*---------------------------------------------------------------*/ /*-- Which papers are presented in the morning? --*/ /*-- add a where clause to restrict the rows selected. --*/ /*---------------------------------------------------------------*/ title2 'Papers presented in the morning'; select author, title, time, duration label='How Long it Takes', time + duration*60 as endtime format=time5. from paper where time < '12:00't;quit;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -