Hi All.
These are my tables:User,Product,DiscountGroup,DiscountUser,DiscountProduct.
DiscountProduct:
id discountGroupId productId discount
--- -------------- --------- -------
1 2 8 2000
2 3 8 1000
3 2 4 4500
Dis...
i have a table assumed like this
[table a]
UID | UNAME
------------------
001 | a
002 | b
003 | c
[table b]
UID | LOGS
----------------------
001 | 2009/08/01
001 | 2009/08/03
003 | 2009/08/02
and i want to have a query like this
UID | LASTLOG
--------------------
001 | 2009/08...
Can someone explain to me how VBA for Access could ship without a simple Max(x,y) Function?
I know it can be done: IIf(x > y, x,y) but really... why?
...
NetCdf: For a grid you can obtain the minimum and maximum value for data in the following way:
MAMath.MinMax dataMinMax = grid.getMinMaxSkipMissingData( data);
float min = (float) (dataMinMax.min);
float max = (float) (dataMinMax.max);
but what if you just have a ucar.nc2.Variable. Can you also obtain this kind of information?
Kind reg...
We are planning to use MSMQ transaction in one of our application.
I am not sure what is the maximum number of transaction we can have for MSMQ?
...
----------Updated ------------
codymanix and moonshadow have been a big help thus far. I was able to solve my problem using the equations and instead of using right shift I divided by 29. Because with 32bits signed 2^31 = overflows to 29. Which works!
Prototype in PHP
$r = $x - (($x - $y) & (($x - $y) / (29)));
Actual code for LEADS...
I have a simple JavaScript Array object containing a few numbers.
[267, 306, 108]
Is there a function that would find the largest number in this array?
...
Hi,
I have a query that looks a bit like this:
SELECT weekEnd, MAX(timeMonday)
FROM timesheet
GROUP BY weekEnd
The valid values for timeMonday are: null, -1, 0, 1-24. At the moment, MAX() places the preference of those values in the order null, -1, 0, 1-24, however what I actually want is -1, null, 0, 1-24, so that null is considered...
I need to find the highest number from 3 different numbers. The only thing I've found is max() but you can only use 2 numbers.
Whats the best way?
...
I have table structures that include a composite primary key of id & revision where both are integers.
I need a query that will return the latest revision of each row. If I understood this answer correctly then the following would have worked on an Oracle DB.
SELECT Id, Title
FROM ( SELECT Id, Revision, MAX(Revision) OVER (PARTITION BY...
I am trying to get the null value in the USAGE_START_DATE column.
So far, what is i got is the unique max records of those with value in the USAGE START DATE column, and could not find any the records with nulls in the USAGE START DATE.
I already tried ISNULL, COALESCE, NVL, NZ.
I got 2 tables: linked by Reservation_id.
Reservation...
Greetings,
I created a list that contains a collection of objects that have this properties: X, Y, Z
I want to find out which object in the collection has the greatest Z
I tried to use the Max() function but I don't understand how it's used...
How can I accomplish this
Thanks in advance
...
I have a little piece of python code in the server script for my website which looks a little bit like this:
console.append([str(x) for x in data])
console.append(str(max(data)))
quite simple, you might think, however the result it's outputting is this:
['3', '12', '3']
3
for some reason python thinks 3 is the max of [3,12,3]!
So ...
I tried but failed:
mysql> select max(1,0);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to use
near '0)' at line 1
...
I have a single table containing many users. In that table I have column called user_id (INT), which I want increment separately for each person. user_id MUST start at 1
I've prepared a simple example:
Showing all names
+--------------+-----------------------+
| user_id | name |
+--------------+-------------------...
select colId,
colTaskType,
MaxID
from tblTaskType
join (
select tblCheckList.colTaskTypeID,
max(colItemNumber) MaxID
from tblCheckList
group by colTaskTypeID
) x on coltaskTypeID = tblTaskType.colID
...
I've got my site content inside an 800px-wide div, I'd like that div to be centered on the page until the browser window width extends past certain distance. At that point, I'd like the content to "lock" into place and not continue to center itself, staying a fixed amount from the left edge.
For example, if the viewers window is 900px w...
So, lets say I have 100,000 float arrays with 100 elements each. I need the highest X number of values, BUT only if they are greater than Y. Any element not matching this should be set to 0. What would be the fastest way to do this in Python? Order must be maintained. Most of the elements are already set to 0.
sample variables:
a...
From C++, are min and max preferable over fmin and fmax? For comparing two integers, do they provide basically the same functionality?
Do you tend to use one of these sets of functions or do you prefer to write your own (perhaps to improve efficiency, portability, flexibility, etc.)?
Notes:
The C++ Standard Template Library (STL) d...
I'm trying to do something like this:
SELECT MAX(
ADDDATE(expirationdate, INTERVAL 1 YEAR),
ADDDATE(now(), INTERVAL 1 YEAR)
)
That is, get "a year from now", or "a year from the expiration date stored in the table", whichever is greater (i'm renewing people's subscriptions).
This obviously doesn't work, since MAX() is for aggrega...