MySQL Forums
Forum List  »  General

Trying to select upto a certain sum of data from a view...
Posted by: Nicholas Stivachtis
Date: August 08, 2013 12:49PM

I'm running mysql 5.5.19 on Linux.

So I have a field called "FileSize" that's the size of a file, amazing I know... I want to issue a query that says "give me the first 2tb worth of files". Now I don't know if using a variable with a += is the best way to do this, but I managed to get this to work, kind of, the problem is it breaks if I try to do an "order by" in the create view

This works:
http://sqlfiddle.com/#!2/0bffc/2

Now when I try to do the same thing, but using a view is where it breaks and returns everything:
http://sqlfiddle.com/#!2/1c7ec/2



**edit** This does work with the view on an older 5.0 version of mysql, but not on my 5.5 version. Is this a bug? or a designed changed?



Edited 2 time(s). Last edit at 08/08/2013 03:32PM by Nicholas Stivachtis.

Options: ReplyQuote


Subject
Written By
Posted
Trying to select upto a certain sum of data from a view...
August 08, 2013 12:49PM


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.