MySQL Forums
Forum List  »  MySQL for Visual Studio

Query returning only 1 record
Posted by: Ben Stevens
Date: June 11, 2014 09:13AM

I'm running MySQL both locally (localhost) on Window7 and on Debian (
This query:
SELECT A.TID, B.TID AS sl_ID,IFNULL(C.InvLNo,0) AS InvLNo_ID, IF(f_catalogue = 1,'Yes','') AS `Cat`, gi_type AS `TransType`,`recdate` AS `Received`, A.qty AS `In` , A.qtyrem AS `Rem` ,IFNULL(C.Qty,0) AS `Out`, A.`serialno` AS `Serial #`, A.TID AS `GI #`FROM `t_goodsin` A INNER JOIN `t_stockledger` B ON A.`sl_id` = B.`tid` LEFT JOIN `t_goodsin_trans` C ON A.`tid` = C.`goodsin_id` WHERE A.`SL_ID` = 2267

.. correctly returns more than 1 row of data from both localhost and
However, if I add an Order By statement
thus ...

I continue to get the right number of results from localhost, but only 1 record from, either the first or last record depending on whether I sort ASC or DESC.

I'm really stumped by this.

A quick search in google didn't turn up much to help, but I admit A. I don't search very hard and B. my search terms may not have been right.

If anyone can help I'd be really happy.

Thanks in advance.

Options: ReplyQuote

Written By
Query returning only 1 record
June 11, 2014 09:13AM
June 11, 2014 03:13PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.