LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (March 2003, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 25 Mar 2003 19:06:31 +0200
Reply-To:     Arto Raiskio <arto@RAISKIO.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Arto Raiskio <arto@RAISKIO.COM>
Subject:      help with an occurs in Proc Sql

could someone post a sample syntax for displaying in Proc Sql the counter for a given value exceeding a limit?

for example. if my SQL Database contains cars and the city is 'chicago' and I want only cars with gasmileage over 25 per gallon

libname mylib odbc noprompt="driver=(SQL Server);server=xx,uid=xx;pwd=xx;database=xxx"; proc sql dquote=ansi; create table mytable as select * from mylib."the_table_of_cars" where (city = 'chicago' AND mileage > 25) ;

now add to that a counter for how many cars, ie. something like

create table mytable as select *, (select count(*) mileage > 25) from mylib."the_table_of_cars" where (city = 'chicago' AND mileage > 25) ;

help?


Back to: Top of message | Previous page | Main SAS-L page