sql,ms-access-2007,max,average
SELECT temp.hhid, temp.country, temp.max_prod, temp.max_area, gen.price_seed, gen.qty_seed, gen.price FROM (SELECT hhid, country, MAX(area) AS max_area, max(total_prod) AS max_prod FROM gen GROUP BY hhid, country) AS temp, gen WHERE (((temp.hhid)=gen.hhid) And ((temp.country)=gen.country) And ((temp.max_prod)=gen.total_prod) And ((temp.max_area)=gen.area)) ORDER BY temp.hhid; Why do some of the results were not seen? I have atleast...

c#,sql,linq,max
I have two tables 1) T_EJV_CREDIT_DS_INDEX 2) T_EJV_CREDIT_DS_INDEX_CONTRACT I would like a SQL query like below as a LINQ expression SELECT MAX(INDEX_FAMILY_VERSION) FROM T_EJV_CREDIT_DS_INDEX cdi INNER JOIN T_EJV_CREDIT_DS_INDEX_CONTRACT cdic ON cdic.INDEX_ID = cdi.INDEX_ID WHERE cdi.INDEX_SHORT_NAME LIKE '%@VARIABLE1%' AND cdic.TENOR = @VARIABLE2 This is what I have attempted so far var...

python,matplotlib,scipy,max
I have fitted curve to a set of data points. I would like to know how to find the maximum point of my curve and then I would like to annotate that point (I don't want to use by largest y value from my data to do this). I cannot...

sql,postgresql,select,max,psql
I have a problem in a psql query. I don't know how to select only the maximum value from a subset of two columns. It's very hard to explain the problem without an example, so I write one: I have a table like that: Athlete | Category | Points at1...

sql,oracle,select,max
I have following Oracle database. A certain ID can have an accepted status, but can continue in a failed status, and return back in an accepted status. This can happen X time, so it can be called a loop ID STATUS TIME INSERT ------------------------------ 1 Accepted 01:00:00 1 Failed 02:00:00...

sql,oracle,max
I'm working on Oracle SQL and HR database, I'm trying to select maximum salary in department like this: SELECT MAX(salary), department_id FROM employees GROUP BY department_id; It works fine, but I want to know >who< is earning the most, so I simply change query this way: SELECT first_name, last_name, MAX(salary),...

mysql,count,max
I have a query that gets the max count of an inner select grouped by three fields. Now I don't only want to have the number, but the whole rows. I just can't figure it out. Here is the query that returns the number: SELECT MAX (count) FROM (SELECT COUNT...

python,lambda,max,xrange,matrix-decomposition
I have found a code that pivotize a square matrix for LU decomposition, but I can't understand some of them. def pivotize(m): """Creates the pivoting matrix for m.""" n = len(m) ID = [[float(i == j) for i in xrange(n)] for j in xrange(n)] for j in xrange(n): row =...

python,list,max
I'm really new to Python but I have a question, that I can't answer with google oder stackoverlow. Mainly because I don't know what to type into the search field as "integers into list" does not get me the result I want... My problem is the following. I have a...

arrays,swift,enums,max,member
I'm trying to use maxElement to work with enums in an array, accessed by .rawValue as shown in the example below: var planets: [Planets] = [.Mars, .Earth, .Jupiter] maxElement(planets.rawValue) I could just use other methods to get the max rawValue but it would be so nice and easy if it...

java,for-loop,max
I am writing a program that finds the taxes based on a person's income. So far the problem I am running into is some numbers that come out don't round up two decimal places and keep on going and I don't know how to get the max out of all...

sql,oracle11g,max,min
I am trying to add max and min to the query below: SELECT category, COUNT(distinct VIN) COUNT FROM stock group by category order by category ASC The desired results are to show the category with the most items in the count and to show the category with the least items...

sql-server,tsql,sql-server-2012,max,sql-insert
I am trying to insert rows from one table to another that are not in the one I am moving them to. I also want to only move the ones that have the highest datestamp. (I want to only insert rows that are not in tb1 and have the max...

r,max,average,minimum
I have 4 variables, each in triplicates, and I need to find the average for each triplicate, in each row, and on top of that find minimum and maximum for each 5th row, in order to plot error bars. Here is an example with two variables: x a1 a2 a3...

android,xml,layout,height,max
This code implements the design of the picture: The upper layout has a maximum height, and if it overcomes this height: a scroll bar is shown. And the bottom layout has a minimum height, and it is aligned to the bottom of the upper layout <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"...

arrays,max
It's been a couple hours. I don't understand arrays well enough to determine the right way to save a value as max and then determine the maximum value within the array. Please help explain how to make the for loop correctly. Thanks. #include <stdio.h> #include <conio.h> #define SIZE 3 int...

html,css,width,max,html-table
I have a table which is very wide. Much wider than the width of the screen due to most of the columns having white-space: nowrap. I have a few "wrapping" columns with white-space: normal. These columns are squished extremely narrow. Setting width: 500px has no effect. Setting min-width: 500px forces...

substring,max,xquery
I want to extract all values of a column from a table, determine the maximum of those values, and return that value. This is what I tried: let $abc := doc("file:///some_local_file")//AOSCAT_MetricDetail//table[@class="pretty-table"]//tr/td[13] return <li>{ fn:max(fn:substring($abc,1,1)) }</li> But fn:substring can't handle a sequence of more than one item. So I tried this:...

c++11,max,min
i implemented a min() and max() function for my Linear Hashtable, but i have little performance issue, because i implemented it straight forward. I just assume that the first element that has been found is the min/mix and then i compare the rest of the elements against it. Is there...

sql,postgresql,max,aggregate-functions
I have table, which looks like this id | item | price1 | price2 I want do get the list of items and for every item I want also to select max price among price1 and price2. Is it possible to do that in one query? Something like SELECT item,...

mysql,select,max,datepart
I need to select a max(date) from a MySQL table and have each part of the date and time be in a separate variable. Something like: select max(date) as year, month, day, hour, minute, second from table How would I do that? ...

mysql,max,directed-acyclic-graphs
I'm making an Acyclic Graph database. TABLE Material (id_item,id_collection,...) PRIMARY KEY(id_item,id_collection) (item can be collection itself, item can be collection of collection) My constraint is id_collection > id_item (to prevent some cycle - 1st step) So before inserting i need to know "Max(Max(id_item), Max(id_collection))" I can get the 2 values...

mysql,max
This is the answers that I want to get.But if I used MAX() function in MySQL, it just return one record.How to handle it? A_plus ID 2 12345 2 45678 As decribed above,The SQL I used as fellow,but it just return one record. SELECT MAX(A_plus_Num) AS A_plus, ID FROM (SELECT...

sql,ms-access,group-by,max
I want to find the most recent entry for a unique combination of two fields in my table. Employee_Number | Cap_Id | Score | Date_Added I want to find the most recent 'Date_Added' for a group of Employee_Number and Cap_Id but also show the 'Score' entered for that group. I...

sql,sql-server,max
I am hoping someone can help me. I'm not that good with SQL. I've looked at countless other posts and just can't figure it out. I have the following data and need to get the most recent date. That would be 09/01/1993. 524 | David | NULL | 1991 |...

sql,max
I have to find the highest price from three different tables but I do not know how to get the max of P now. PC(model,speed,ram,hd,price) Laptop(model,speed,ram,hd,screen,price) Printer(model,color,type,price) SELECT model FROM ((SELECT MAX(price) FROM PC) UNION (SELECT MAX(price) FROM Laptop) UNION (SELECT MAX(price) FROM Printer)) AS P WHERE MAX(P); Could i...

sql,ms-access,join,max
I have 2 tables named Reefers and Alerts. I want to join these two tables. Now, how to get a result that shows the last record of each ReeferNo from Alerts table where the AlertType is equal to "Temperatures"? TABLE 1: Reefers ReeferNo Transporter E-110 Express1 E-111 Express1 E-112 Express1...

c++,arrays,max
This question already has an answer here: Finding the highest number in an array C++ 5 answers I have an array of integers that has 18 values. I need to find which one of them is the largest. I tried like this: FinalValue = max(values); However, it had an...

r,max,simultaneous,which
Let's make a small example first, that computes in R: x<- c(1,3,1,4,2) max(which(x<2)) [1] 3 Now, I would like to do this not just for one value 2, but for many values simultaneously. It should give me something like that: max(which(x<c(1,2,3,4,5,6))) [1] NA 3 5 5 5 5 Of course...

c++,vector,max,min
I have written code that outputs the total rainfall for a set amount of years. My question is how would I just display the year with the largest and smallest rainfall i.e the maximum and minimum of the dataset with the corresponding year. The output i have so far is:...

php,mysql,max
My site is a Prestashop (1.5.6.2). Some of my product can have a lower price according to the number of product ordered. And I'd like to mention somewhere the minimum price of the product (so I need the maximum amount of reduction to make this happen). Table 1 (my price...

c,arrays,char,size,max
I have written some code in C by taking the maximum size of char array as 100. It worked well. But when I increase the maximum size of char array to 10000 it gives me segmentation fault(as it has exceeded its limit). Can someone tell me how can I increase...

matlab,function,matrix,max
Is there any function that can calculate cumulative maximum for a double matrix? I have a 1*3000 matrix and I need to calculate the cumulative maximum. For example if the matrix is: A = [8 3 6 7 9 10 6 2 2 3] The cumulative maximum array will be:...

java,methods,max,min
I'm trying to make a script that prints out the biggest and smallest number using methods, however I have no clue why my methods don't work... I placed a comment next to where I keep getting the error. I don't really need help with getting the script to work however...

excel,if-statement,max,excel-2010,array-formulas
I'm stumped on a particular problem with some data that's imported to me. I have zero control over how the data is coming in. (Just to clarify that point). I have two columns and 107,000 rows. Column A has an ID#, Column B has the corresponding Date. The issue I...

sql-server,max
I am using SQL Server 2014 and I have a simple query that gives me the following output if I run it against the relevant table. So here's the query: use MyDatabase select ReservationStayID , NonRoomBundleID ,StayDate from ResStayNonRoomBundle where ReservationStayID = 11676 Output is as follows: ReservationStayID NonRoomBundleID StayDate...

oracle,plsql,exception-handling,oracle11g,max
I wrote the below query expecting NO_DATA_FOUND exception to be thrown when no rows found. BEGIN SELECT MAX(A_id) + 1 INTO id_variable from table_A; EXCEPTION WHEN NO_DATA_FOUND THEN SELECT MAX(A_id) + 1 INTO id_variable from table_A_archive; END; there is no data in table_A but no exception was thrown and eventually...

java,variables,max
I want to find the variable having the maximum value from three variables. Im using the given code to find the maximum value, but it only can output the maxium value.I want to get the variable having the maximum value.any methods? int x=1; int y=2; int z=3; int max =...

sql,postgresql,max,date-range
I am trying to get a maximum value from one table using the date range from another table. I am using SQL on a postgresql database. The goal is to get the maximum value for the date range added to the table that has the start and end date (by...

parallel-processing,max,opencl,gpgpu,barrier
I've found a piece of OpenCL kernel sample code in Nvidia's developer site The purpose function maxOneBlock is to find out the biggest value of array maxValue and store it to maxValue[0]. I was fully understand about the looping part, but confused about the unroll part: Why the unroll part...

mysql,sql,max,alias
What I want to do is this: select AlbumId from ( select Album.AlbumId, Sum(Track.UnitPrice) as Total from Album inner join Track on Album.AlbumId = Track.AlbumId group by Album.AlbumId ) tpt where Total = (select max(Total) from tpt); but am getting: Table 'db.tpt' doesn't exist -which probably makes sense. However, I...

mysql,sqlite,max
I have more than one items with the highest price on my database and I would like to know how to return the most expensive items with the highest price on my database, without using LIMIT. I have tried using SELECT MAX(price) FROM items but it only returns one item...

scheme,max,racket,min
I need to get the max and min of a list in scheme. I have the whole code but there is something wrong. I am not sure what, maybe with the parenthesis. Can anyone help? #lang racket (define (maxmin L) (cond ((null? L) '()) ((null? (cdr L)) (list (car L)...

r,max,min
NAME Number cars 10 people 340 bus 4 I have to find way to rapresent minimum and maximum numeric value with his correspondent name from first coulmn. if I put command : min(data[,2]) max(data[,2]) the results are only values the final result should be displayed like : for minimum value*...

python,max,time-complexity,complexity-theory
I am trying to calculate the time complexity of the next function, max_list11, which finds a maximum of a list recursively: def max11(L,left,right): if left==right: return L[left] return max(L[left], max11(L,left+1,right)) def max_list11(L): return max11(L,0,len(L)-1) From what I found out, the time complexity should be O(n), since what the function does...

java,math,max,maxlength
I am passing 2 arrays to the controller with different lengths, I want to execute a for loop and length of that will be the max of the length of 2 arrays. I am not getting how to execute that. I tried Math.max but its giving me error as cannot...

python,list,dictionary,lambda,max
I have a dictionary of lists h={'1':['a','3','56'],'2':['a','2','125']} I want to get the key and value for the maximum based on third element of h[k] i.e (2,125) I tried to understand lambda function and wrote this: max(h, key=lambda h : int(h[k][2]) for k in h.keys()) But it gives me a SyntaxError...

java,arrays,max
When I am doing my assignments I get really confused when I have to find the largest 3 numbers in a list of numbers(data structure not specified). I am totally struck with what I have to do. Any help?

sql-server,tsql,group-by,max,aggregate-functions
I have a T-SQL query of the form: SELECT f.fizz_name, b.buzz_version, fu.foo_name FROM fizz f INNER JOIN buzz b ON f.fizz_id = b.fizz_id INNER JOIN foo fu ON b.buzz_id = fu.buzz_id WHERE f.bar LIKE 'YES' When I run this query I get the following results: fizz_name buzz_version foo_name ==================================== Gamma...

python,max
hello I am kind of confused about the max() function, I have the following code: a = '9:30' b = '10:44' c = '8:22' x = max(a, b, c) print (x) so my question is: why does this return 9:30? and if I were to delete the a from inside...

php,html,sql,count,max
I have been scrolling through various examples but can't seem to get the right answer. What I am trying to get here is to display: staffID,name from Table Staff total no. of tasks that the staff is involved in from StaffWorksInTask (Only with the staff that is involved with most...

mysql,group-by,max
What I am trying to get is the row contents containing the highest price. I am not sure if I need to self-join, or use a having statement. Most of the attempts I have tried netted me no returned rows. Effectively I want to say "WHERE PRICE IS MAX". I...

python,arrays,numpy,max
I've 24 arrays in a list and I'd like to crate an array with the maximum of each index. In other words, I've something like this list_value = [array([1,2,3]), array([4,5,6]), array([7,8,9]), array([1,5,8]), array([9,4,3])] In my case, each array has 280000 values. And I would like create an array like this:...

mysql,sql,database,max
I have a query which I want to return the highest id value in idevent that is within a given range of sensor ID's (sensorID) however the query is not returning the highest value. The results when I run the query minus the max() statment: mysql> SELECT * FROM events...

sql,sql-server,select,max
I want to select the last note from notes with the following query: SELECT cn.Note, MAX(cn.Date) FROM CarsNote cn WHERE CustomerID = '80' AND cn.Type = 'INFO' GROUP BY Note When I execute this query i get four results but i want only the last note. When i do SELECT...

matlab,matrix,max,cell-array
I've two matrix a and b and I'd like to combine the rows in a way that in the first row I got no duplicate value and in the second value, columns in a and b which have the same row value get the maximum value in new matrix. i.e....

matlab,optimization,max
I have an optimization problem which is solved with fmincon. In this problem I have a constraint that says every element of the vector L must be less than or equal to 1. So basicaly I can add this constraint like this C=max(L)-1 ; % C(X)<0 But now I want...

r,data.frame,max
I have a data.frame and I wish to get the row that contains the maximum value for the given column Total Txn_date Cust_no Acct_no cust_type Credit Debit Total 09DEC2013 17382 601298644 I 1500 0 1500 16DEC2013 17382 601298644 I 500 0 500 17DEC2013 17382 601298644 I 0 60 60 18DEC2013...

excel,if-statement,excel-formula,max,excel-2010
I can't quit figure out what I am doing wrong here, I know how to do the formula in multiple steps but can not figure out how to do it in one step all together. So what I am trying to do here is in column A there is numbers...

mysql,join,max,distinct,coalesce
I have two tables: Job_Order -id -creation_date -assigned_to -job_ordertype -client Job_Order_Stage -id -stage -date -job_order(foreign key to job_order) I want to get all rows in the job_order and set stage to 0 if id not exist in the Job_Order_Stage. And I also want to get only the row with max(stage)...

excel,if-statement,excel-formula,max,worksheet-function
I have data, for example: John Doe MD 1 Ben Doe PA Cal Doe MD 1 Drum Doe PA Egg Doe NP Fun Doe MD 1 So everywhere there's an MD I have an IF condition assigning the number 1. But I want to isolate and pull all the names...

javascript,node.js,max,child-process
hopefully I can describe what I'm looking for clearly enough. Working with Node and Python. I'm trying to run a number of child processes (.py scripts, using child_process.exec()) in parallel, but no more than a specified number at a time (say, 2). I receive an unknown number of requests in...

r,max,group
I have a data frame in R with columns "name" and "length". The "name" is not unique and the same "name" repeats several times in the data frame. But I wanted to keep only one row with the largest "length" for each "name". Which function in R can I use...

algorithm,sum,max,hungarian-algorithm
I have a problem to solve, and do not see any optimal solution :/ The problem is: I have n workers and k jobs. Each job is to be done by specified number of workers, and each worker has his level of happines for each job. I have to to...

java,elasticsearch,max,histogram,aggregation
I am quite new to elasticsearch, so apologies if this is a trivial question. I have a time series with irregular updates every n number of seconds that I want to plot historically. The data contains a long variable called 'score', and a long variable with the epoch called 'time'...

swift,max,nsdecimalnumber,roundup
Let's say we have an NSDecimal constant called total and it contains the value of 3.33333333 divided by 10/3. 10 and 3 are both NSDecimalNumber. We want the total to be 4 as an NSDecimalNumber in Swift. let total = ten/three // the ideal total would be rounded up whenever...

sql,max,google-bigquery
I have this kind of table (just for example.. in my case this table has over 60000 records) I would like to know how to make a select to get which gender rate a movieId (or songId) with higher rate? I do query like this: select * from ( SELECT...

mysql,sql,database,max
I'm a student and am working on a MySql assignment given to us for the holidays. I have a table that looks something like this : name dept salary A Sales 100 B Marketing 200 C Sales 800 (Sorry I'm new to stackexchange so I don't know how to display...

python,max
I am new to python, and am trying to learn it with newmans computational physics. I was trying to make a program to solve one of the exercises. It is to calculate the highest binding energy using an approximate formula . I made this program, to find the binding energy:...

ruby,max
I just started learning Ruby a few weeks ago so I apologize for being a complete noob. I am writing a simple program that will find the largest phone number input based on the sum of its digits. Here is what I have so far: print 'Enter phone numbers' phone_numbers...

c#,linq,max
I have the following two tables that store the calls that the users made, Users ----- IdUser int PK, Name varchar(50) Calls ------ idCall int PK, idUser int FK, CallDate datetime This is the code i tried but i cant seem to get it to work var resultado = (from...