How do I get the min timestamp value of the same Id number with its corresponding Value using SQL?  Would anybody help me with this problem? (Please see attached image below)  Sample Table    Sample Table of what should be the result
I have a query which selects a max value over all the values of in a datetime column (dtimesent).  select dtimesent, max(ResponseTime) AS maxtime FROM allrequests  where Request like '%Requestsa%' group by dtimesent   I need to get the value of the request colmn for each max response time in each group by. Is there any easy way to do this?  There can be multiple rows per dtimesent value so I can't just include the request column in the group by,  Many thanks,
How to use a field value in Template.php Conjugate to $\cos z$ is not equal to $\cos z$ conjugate $\overline{\cos(z)}\neq\cos(\overline{z})$ I have a dilemma. I have a task where I'm supposed to show that $|\cos z|^2+|\sin z|^2=1$ if and only if $z\in \mathbb{R} $. In my argument I have that $$\cos z\cdot\overline{\cos z} + \sin z\cdot\overline{\sin z}=\cos z\cdot \cos\overline{z} + \sin z\cdot \sin\overline{z}$$ but my teacher said that $\overline {\cos z} \neq \cos \overline{z}$.  Is this true?  But $$\overline{\cos(z)} = \overline{\frac{e^{iz}+e^{-iz}}{2}}=\frac{e^{-i\overline{z}}+e^{i\overline{z}}}{2}=\cos(\overline{z})$$ Linear Algebra: If $A^3 = I$, does $A$ have to be $I$? Android: How to open a specific folder via Intent and show its content in a file browser? Why should the interface for a Java class be preferred? would report a violation for:  ArrayList&lt;Object&gt; list = new ArrayList&lt;Object&gt;();   The violation was "Avoid using implementation types like 'ArrayList'; use the interface instead".  The following line would correct the violation:  List&lt;Object&gt; list = new ArrayList&lt;Object&gt;();   Why should the latter with List be used instead of ArrayList? Let's say you want to save a bunch of files somewhere, for instance in BLOBs. Let's say you want to dish these files out via a web page and have the client automatically open the correct application/viewer.  Assumption: The browser figures out which application/viewer to use by the mime-type (content-type?) header in the HTTP response.  Based on that assumption, in addition to the bytes of the file, you also want to save the MIME type.  How would you find the MIME type of a file? I'm currently on a Mac, but this should also work on Windows.   Does the browser add this information when posting the file to the web page?  Is there a neat python library for finding this information? A WebService or (even better) a downloadable database? How to detect if JavaScript is disabled? There was a post this morning asking about how many people disable JavaScript. Then I began to wonder what techniques might be used to determine if the user has it disabled.   Does anyone know of some short/simple ways to detect if JavaScript is disabled? My intention is to give a warning that the site is not able to function properly without the browser having JS enabled.   Eventually I would want to redirect them to content that is able to work in the absence of JS, but I need this detection as a placeholder to start. Can I visit the US for tourism on a previously unused B1/B2 visa? Note: This is NOT a duplicate of  Difference: In both other questions, the posters traveled once to the US for the original purpose for which the B1 visa was obtained. Their question is about visiting again using the same visa. However, I've not traveled to the US yet, and I'm planning my visit. What I want to understand whether I can use this visa for a visit whose purpose is not the same as what was submitted along with the application.  Can I use a B1/B2 visa for tourism that was originally obtained for business purposes BEFORE I actually visit the US even once? I had applied for a business visitor visa for a valid business reason but by the time I got it stamped, my plan changed. So I've not visited the US even once. Can I now use this visa to visit as a tourist without having used that visa for its original intended purpose? PS: I live in India. Question title overlap in new design when title is longer Today I noticed that in new design view count is getting overlapped with question title on scifi.se for longer title:    But it's not site specific as same problem happen in Beta site too ( Hinduism.se):    That's why asked in main meta. What uses are there for "placement new"? Has anyone here ever used C++'s "placement new"? If so, what for? It looks to me like it would only be useful on memory-mapped hardware. What is the world's biggest Schrodinger cat? In an HTML table, the cellpadding and cellspacing can be set like this:  &lt;table cellspacing="1" cellpadding="1"&gt;   How can the same be accomplished using CSS? Obtaining zero-length string from strtok() What do you feel when crossing the event horizon? Construct a field of 25 elements. We need to construct a field of 25 elements.  By using a result : For a prime p and a monic irreducible polynomial $p(x)$ in $\Bbb F_p [x]$ of degree $n$ , then the ring $(\Bbb F_p [x] / &lt;p(x)&gt;)$ is a field of order $p^{n}$.  So , for the question problem above , we need a irreducible polynomial of degree $2$ in $\Bbb Z_5 [x]$.  Solution says , $x^{2} + x +1$ does our job , since it's irreducible in $\Bbb Z_5 [x]$.  My question : Can't we take $ x^{2} + 2$ , it has no zeroes in $\Bbb Z_5$ , and is irreducible. In every solution I've gone through , the polynomial $x^{2} + x+1$ is taken. Can't we consider $ x^{2} + 2$ ? Show "Insufficient Privileges" directly when clicking 'Edit' (override), not on 'Save' If a user clicks 'Edit' on an opportunity which he isn't allowed to edit, the "Insufficient Privileges" page directly appears. This is good. If a user clicks 'Edit' on a custom object (which has an edit override that points to a visualforce page), he first sees the form without problems, and the "Insufficient Privileges" page only appears when he tries to save it. This behaviour is misleading for the users, because they think they can manipulate the data and put effort into it, and only afterwards they realize that this wasn't possible after all.  An idea was to check at page load if the user has edit permissions and otherwise redirect him to the "Insufficient Privileges" page.  Might there be another way? Thanks! Why did Owen Chase not fire his harpoon at Moby Dick? In movie In the Heart of the Sea, when Owen Chase finally faces the big white whale (later named Moby Dick) with his harpoon, why does he not do it? Is there a way to find comments you made on YouTube? What regular expression will match valid international phone numbers? How does Cantor's diagonal argument work? I'm having trouble understanding Cantor's diagonal argument.  Specifically, I do not understand how it proves that something is "uncountable".  My understanding of the argument is that it takes the following form (modified slightly from the  article, assuming base 2, where the numbers must be from the set $ \lbrace 0,1 \rbrace $):  \begin{align} s_1 &amp;= (\mathbf{0},1,0,\dots)\\ s_2 &amp;= (1,\mathbf{1},0,\dots)\\ s_3 &amp;= (0,0,\mathbf{1},\dots)\\ \vdots &amp;= (s_n \text{ continues}) \end{align}  In this case, the diagonal number is the bold diagonal numbers $(0, 1, 1)$, which when "flipped" is $(1,0,0)$, neither of which is $s_1$, $s_2$, or $s_3$.  My question, or misunderstanding, is: When there exists the possibility that more $s_n$ exist, as is the case in the example above, how does this "prove" anything?  For example:  \begin{align} s_0 &amp;= (1,0,0,\mathbf{0},\dots)\ \ \textrm{ (...the wikipedia flipped diagonal)}\\ s_1 &amp;= (\mathbf{0},1,0,\dots)\\ s_2 &amp;= (1,\mathbf{1},0,\dots)\\ s_3 &amp;= (0,0,\mathbf{1},\dots)\\ s_4 &amp;= (0,1,1,\mathbf{1},\dots)\\ s_4 &amp;= (1,0,0,\mathbf{1},\dots)\ \ \textrm{ (...alternate, flipped } s_4\textrm{)}\\ s_5 &amp;= (1,0,0,0,\dots)\\ s_6 &amp;= (1,0,0,1,\dots)\\ \vdots &amp;= (s_n \text{ continues}) \end{align}  In other words, as long as there is a $\dots \text{ continues}$ at the end, the very next number could be the "impossible diagonal number", with the caveat that it's not strictly identical to the "impossible diagonal number" as the wikipedia article defines it:     For each $m$ and $n$ let $s_{n,m}$ be the $m^{th}$ element of the $n^{th}$ sequence on the list; so for each $n$,      $$s_n = (s_{n,1}, s_{n,2}, s_{n,3}, s_{n,4}, \dots).$$      ...snip...      Otherwise, it would be possible by the above process to construct a sequence $s_0$ which would both be in $T$ (because it is a sequence of 0s and 1s which is by the definition of $T$ in $T$) and at the same time not in $T$ (because we can deliberately construct it not to be in the list). $T$, containing all such sequences, must contain $s_0$, which is just such a sequence. But since $s_0$ does not appear anywhere on the list, $T$ cannot contain $s_0$.      Therefore $T$ cannot be placed in one-to-one correspondence with the natural numbers. In other words, it is uncountable.   I'm not sure this definition is correct, because if we assume that $m = (1, \dots)$, then this definition says that "$s_n$ is equal to itself"&mdadsh;there is no "diagonalization" in this particular description of the argument, nor does it incorporate the "flipping" part of the argument, never mind the fact that we have very clearly constructed just such an impossible $T$ list above.  An attempt to correct the "diagonalization" and "flipping" problem:  $$s_n = (\lnot s_{m,m}, \lnot s_{m,m}, \dots) \quad \text{where $m$ is the element index and} \quad\begin{equation}\lnot s_{m,m} = \begin{cases}0 &amp; \mathrm{if\ } s_{m,m} = 1\\1 &amp; \mathrm{if\ } s_{m,m} = 0\end{cases}\end{equation}$$  This definition doesn't quite work either, as we immediately run in to problems with just $s_1 = (0),$ which is impossible because by definition $s_1$ must be $ = (1)$ if $s_1 = (0)$, which would also be impossible because...   Or more generally, with the revised definition there is a contradiction whenever $n = m$, which would seem to invalidate the revised formulation of the argument / proof.  Nothing about this argument / proof makes any sense to me, nor why it only applies to real numbers and makes them "uncountable". As near as I can tell it would seem to apply equal well to natural numbers, which are "countable".  What am I missing?