Simple SQL Question

Jim Pistrang jim at jpcr.com
Wed Oct 26 20:05:37 UTC 2022


      
  

  
  
Hi Dias,
  

  
You can use an embedded select for this. Something like…
  

  
Select [lots of colums] from [mytable] where [unique column name] = (select max([Unique column name] from [mytable])
  

  
Jim
  
  
  
  
  
Jim Pistrang
  
home: 413-256-1737
  
cell: 413-237-5710
  
  
  
  
  

  
  
>   
> On Oct 26, 2022 at 3:44 PM,  <Das Goravani (mailto:goravanis at gmail.com)>  wrote:
>   
>   
>   
>  I have tried to look this up, scoured others existing code, to no avail How do you Select the highest Primary Key value With a couple other columns Where it’s for a certain customer, and "current" is true I have this so far: SELECT max(CC_SEQ),CC_CREDIT_NUM,CC_TOKEN FROM cust_cc WHERE CC_CCODE=@[iRowCust.CCODE] AND CC_CURRENT=1 It’s not working, doing it in an exec direct using the statement object It’s returning no rows when I know there is one that matches _____________________________________________________________ Manage your list subscriptions at https://lists.omnis-dev.com Start a new message ->  mailto:omnisdev-en at lists.omnis-dev.com  
>
>   
  
  
     


More information about the omnisdev-en mailing list