Hi there,
I want to select some entries based on a max+sum condition.
mytable
----------
id | col1 | col2
I want to select all entries that have the sum of col1 & col2 greater than or equal to the max of sum minus X. (don't ask me why :) )
So far I managed to get the sum OK (hereafter aliased as "total") with:
SELECT id,SUM(col1 +...
Hey,
So if I had a table in my database with the values
1
2
3
4
NULL
And I executed the query
SELECT MAX(col1) FROM <table>
I'd get 4. Is there any way to change this so Null would be treated as the maximum as oppose to the minimum?
Thanks!
...
Is there a maximum file size the XMLReader can handle?
I'm trying to process an XML feed about 3GB large. There are certainly no PHP errors as the script runs fine and successfully loads to the database after it's been run.
The script also runs fine with smaller test feeds - 1GB and below. However, when processing larger feeds the scr...
I have two tables which both have the column DateTime.
How can I get the MAX() DateTime?
The shorter/simpler the better, because this is just part of a larger query.
...
Where are MIN and MAX defined in C, if at all? What is the best way to implement these, as generically and type safe as possible (compiler extensions/builtins for mainstream compilers preferred).
...
I observed that there was at some point a <? and >? operator in GCC. How can I use these under GCC 4.5? Have they been removed, and if so, when?
Offset block_count = (cpfs->geo.block_size - block_offset) <? count;
cpfs.c:473: error: expected expression before ‘?’ token
...
Hello,
I'm running requests on an Oracle database.
One of my tables contains time slots for Elements and there can be several time slots for the same Element so that the following example is correct :
ID ELEMENT_ID BEGIN_DATE END_DATE
--------------------------------------------
1 1 01/01/2007 01/06/2007
2 ...
Is there a way to get a row that has the MAX() when two fields are considered, giving one of them precedence. For example
ID Column_A Column_B
----------------------------
1 1 3
2 3 2
3 2 2
4 3 1
Would return
ID Column_A Column_B
--------...
hi everybody,
im working on a project
and i want to create a virtual midi input with python to flstudio (fruityloops)
i have googled a bit but all the modules i could find was about creating midi files which is not my issue.
so what module should i use for midi i/o with python?
...
I have a table that records a history of address updates, called transaction. The schema is something like row_id (int, PK), user_id (int), address1 (varchar), transdate (timestamp).
I want to query the table and have a single row returned for a user showing what is the latest row (i.e. greatest timestamp), but if there is data in the ...
I have a table called order which contains columns id, user_id, price. I would like to select each user's most expensive order - the order for which that user paid the highest price. I want to select order.user_id and order.price in the same query.
...
Hi,
Ive got a Zend_Db_Table
Now I want to get the maximum available value of a field.
Is there a way to get the MAX(number) value or do I need to use basic SQL?
Thanks!
...
>SELECT instmax
FROM
(SELECT instmax,
rownum r
FROM
( SELECT * FROM pswlinstmax ORDER BY instmax DESC NULLS LAST
)
)
WHERE r = 2;
INSTMAX
-------
1049
>SELECT instmax
FROM
(SELECT instmax,
rownum
FROM
(SELECT * FROM pswlinstmax ORDER BY instmax DESC
)
)
WHERE...
I have a table called order which contains columns id, user_id, price and item_id. Item prices aren't fixed and I would like to select each item's most expensive order. I want to select user_id, item_id and price in the same query. I tried the following query but it doesn't return the correct result set.
SELECT user_id, item_id, MAX(pri...
Hi,
I have a nxm matrix and I need to find the maximum of sum of its values in distinct rows and columns.
For example considering the following Matrix:
m1 m2 m3
n1 1 2 3
n2 4 5 6
n3 7 8 9
n4 10 11 12
The max will be 12+8+4 = 24
Note that finding the max and eliminating all values belonging to that column or ...
There is query which is asking for favourite products which is bought by each coustomer. i have to select and in the first select i have selected the count of products that each customer bought. in the other select i want to select the maximum of that boughts for each customer.but when i want to select max(previous select column) it gets...
How can I structure a mySQL query to delete a row based on the max value.
I tried
WHERE jobPositonId = max(jobPostionId)
but got an error?
...
This is based on my previous question.
I have the following table
Table1
JobPositionId | JobPositionName
1 | Sound
2 | Lights
3 | Sound
4 | Ground
How can I delete row three (Name = sound, and max position)
...
Hi,
I'm ashamed of myself 'cause i can't do this query properly... I have a table like this
nom | code_geo | valeur | indice
-------+----------+--------+--------------------
AISNE | 02 | 81573 | 0.05
SOMME | 80 | 79520 | 0.03
OISE | 60 | 70004 | 0.09
what i need to do is divide each "indice" by the m...
class JsTree_JsonData(db.Model):
JsonData=db.TextProperty()
i can;t find what is the TextProperty
did you know ?
thanks
...