Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sql question
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00929771
Message ID:
00929775
Views:
7
Steve,


Try
SELECT * FROM mytable mt1 ;
  WHERE price IN ( ;
   SELECT MAX(price) FROM mytable mt2 ;
    WHERE mt1.date = mt2.date) ;
  INTO CURSOR crsResult
>Suppose you ahve a table like the one below and you want to use a select statement to
>make another table that includes only
>a) the highest prices for each date
>b) but if there is only 1 entry for a date and the price is 0, it includes that date too
>Is there a way to do this with an SQL statement?
>Thanks STEve
>______ ____ __
>number
>of
>record date price
>______ ____ __
>1       1/1  0
>2       1/1  7
>3       1/3  0
>4       1/3  8
>5       1/5  0
>6       1/8  0
>7       1/9  0
>8       1/9  8
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform