× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 16-Jun-2015 08:21 -0600, Hoteltravelfundotcom wrote:
betwixt, other posts snipped
On 16-Jun-2015 07:35 -0600, Hoteltravelfundotcom wrote:
I have one table with all orders info and other table has the
shipping info. I only need to 'chain' one row from the shipping
table to get the ship via method. But its multi rows
so I trued top1 its not compiling. how to read just the first row
in sql on the i. I tried
top1, topn nothing is compiling.
(
SELECT TOP 1
STDTA.pshipll1.phviac

FROM
STDTA.pshipll1
WHERE
"SHPWEIGHT"."IDORD#" = STDTA.pshipll1.phord#
)

<<SNIPped>>

FETCH FIRST 1 ROW ONLY is the way.

But not without an ORDER BY, unless either all phviac values are identical across the one phord# value or perhaps which non-distinct phviac value is immaterial. If not the latter, then that order-by must be more than on just order# or other than on just the order#; otherwise, which row [and thus which value for phviac] is selected, would be unpredictable.

I don't use group by because am using
a logical that is order by order#


And the key of the LF matters, how? Querying a logical does not ensure any order for how the rows are selected, despite the LF may be keyed; thus why the ORDER BY is required in the subquery as mentioned above. So while a GROUP BY query may be precluded for a valid reason, what is the key of the LF is not a valid reason.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.