SQL help

Jay Madren jay at jaymadren.com
Wed Jan 1 14:28:38 CST 2014


Something like this should work:

SELECT voyageID FROM voyages WHERE RecID = (SELECT RecID - 1 FROM voyages
WHERE voyageID = 'S1301')



On Wed, Jan 1, 2014 at 2:13 PM, william humphrey <bill at bluewatermaritime.com
> wrote:

> Happy new year.
>
> Can someone help me with this.
>
> How do I request a field data from a RecID one less than the current
> RecID that I know the record ID for?
>
> I do this:
>
> SELECT voyageID, RecID FROM voyages WHERE voyageID = 'S1301'
>
> that gives me a RecID of 630
>
> the result I want is:
>
> SELECT voyageID FROM voyages WHERE RecID = 629
>
> which gives me the voyageID for the preceding record.
>
> Can someone help me write that in one line of SQL?  Some kind of RecID
> - 1 where voyageID = 'S1301' ???
>
> Thanks
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macserve.net/pipermail/valentina/attachments/20140101/09ccd61d/attachment.html>


More information about the Valentina mailing list