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 (192.168.0.25)
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 192.168.0.25
However, if I add an Order By statement
thus ...
ORDER BY A.TID DESC;

I continue to get the right number of results from localhost, but only 1 record from 192.168.0.25, 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.
Ben

Options: ReplyQuote


Subject
Views
Written By
Posted
Query returning only 1 record
2062
June 11, 2014 09:13AM
1002
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.