I have this script  select  *  from psPatDiscounts  where cancelflag = '0'  and refdate between  '2014-01-01 14:03:00'  and '2014-01-31 14:03:00' group by FK_psPatRegisters   however, after running this script it gives me this error message :     Msg 8120, Level 16, State 1, Line 1   Column 'psPatDiscounts.PK_TRXNO' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
I know I need to have (although I don't know why) a GROUP BY clause on the end of a SQL query that uses any aggregate functions like count, sum, avg, etc:  SELECT count(userID), userName FROM users GROUP BY userName   When else would GROUP BY be useful, and what are the performance ramifications?
Why is the wild card character * so different between the zip and rm commands? I put together a script to do some file operations for me. I am using the wild card operator * to apply functions to all files of a type, but there is one thing I don't get. I can unzip all files in a folder like this  unzip "*".zip   However, to remove all zip files afterward, I need to do   rm *.zip   That is, it does not want the quotation marks. The unzip, on the other hand, does not work if I just give it the * (gives me a warning that "files were not matched").   Why is this different? To me, this seems like the exact same operation. Or am I using the wild card incorrectly?   in Unix do not really go into this, and I could not locate anything in the rm or zip docs.  I am using the terminal on a Mac (Yosemite). Question  I want to write a book in Arabic (I have an Arabic keyboard, so I don't need a converter). By Arabic book I mean literally Arabic:    title, table of contents  etc    all in Arabic.   The equations, however, I want to write them in English/Latin.  Related    This link helped a lot but it was for Arabic texts in an English main document.    I already checked these two (and plenty other sites). Sneak Damage multiplier: Does it apply to magical damage too? Example:   Dagger 1 = 18 Damage, 25 Shock  Dagger 2 = 33 Damage, no magic  Using the above, when I sneak attack and have the 15x multiple then is the damage caused by Dagger 1 is (18+25)*15 or (18*15)+25 ?  Same question with bows and arrows, does the multiplier apply to potion damage or/and the magical(enchanted)?  In other words, do the multipliers apply to the base damage only or to the final damage being caused by the weapon (base+magical+skill+potion+perks etc)?  I am confused. :-? C Scanf suddenly stopped reading in values Additive group contains exactly three elements of the set $\{p,p+q,pq,p^q,q^p\}$ Let $p$ and $q$ be distinct primes. There is a proper subgroup $J$ of the additive group of integers which contains exactly three elements of the set $\{p,p+q,pq,p^q,q^p\}$. Which three elements are in $J$?  I know the solution is $\{p,pq,p^q\}$. However I do not understand why. I thought $J$ can not even be a finite group. Maybe there is serious misunderstanding of the problem. Can anyone give me a hand? Thanks. Calling a parent window function from an iframe Prove that $ S=\{0\}\cup\left(\bigcup_{n=0}^{\infty} \{\frac{1}{n}\}\right)$ is a compact set in $\mathbb{R}$. Single word describing a person new in something What is a word for someone who is totally new in something or participates in something for the first time? I have installed Ubuntu 13.04 on my desktop (runs like a charm). Then I used Crouton to install Ubuntu 12. 04 on my chromebook samsung (ARM). It also works quite well.  Here comes my question. Can we have a true Ubuntu (preferably 13.04) on my ARM chromebook?  It seems that the Crouton/Ubuntu is not 100% the real thing.  The best option would be to have the full Ubuntu 13.04 and remove the Chrome OS. When $\operatorname{Hom}_{R}(M,N)$ is finitely generated as $\mathbb Z$-module or $R$-module? Assume that $M$ and $N$ are two finitely generated $R$-modules. Then $\operatorname{Hom}_{R}(M,N)$ is a finitely generated $\mathbb Z$-module and/or $R$-module (in this case, assume that $R$ is commutative)?   Note that $R$ is not Noetherian ring. Is there any counterexample (for any cases)? How to copy files via terminal? I have read about copying files with terminal but these examples will help me a lot. So here is what I want to do:  Examples:   I have a file in /home/levan/kdenlive untitelds.mpg and I want to copy this file to /media/sda3/SkyDrive and do not want to delete any thing in SkyDrive directory. I have a file in /media/sda3/SkyDrive untitelds.mpg and I want to copy this file to /home/levan/kdenlive  and do not want to delete any thing in kdenlive directory  I want to copy a folder from home directory to sda3 and do not want to delete any thing on sda3 directory and opposite I want to cut a folder/file and copy to other place without deleting files in that directory I cut it into. Why is Main method private? IllegalArgumentException or NullPointerException for a null parameter? I have a simple setter method for a property and null is not appropriate for this particular property. I have always been torn in this situation: should I throw an , or a ? From the javadocs, both seem appropriate. Is there some kind of an understood standard?  Or is this just one of those things that you should do whatever you prefer and both are really correct? Why does minimizing the MAE lead to forecasting the median and not the mean? From the , specifically :     A forecast method that minimizes the MAE will lead to forecasts of the   median, while minimizing the RMSE will lead to forecasts of the mean   Can someone give an intuitive explanation of why minimizing the MAE leads to the forecasting the median and not the mean? And what does this means in practice?  I have asked a customer: "what is more important for you to make mean forecasts more accurate or to avoid very inaccurate forecasts?". He said that to made mean forecasts more accurate have higher priority. So, in this case, should I use MAE or RMSE? Before I read this citation I believed that MAE will be better for such condition. And now I doubt. Remove specific duplicates (all but latest) When removing duplicate rows, using the below query from  tutorial, how would I go about forcing which of the found duplicates to remove?  DELETE FROM dbo.ATTENDANCE      WHERE AUTOID NOT IN (SELECT MIN(AUTOID) _ FROM dbo.ATTENDANCE      GROUP BY EMPLOYEE_ID,ATTENDANCE_DATE)    And this works great. The reason why I am using this one is because the only unique id available is one in the IDENTITY column. And to determine if there are duplicate rows I have to look at a combination of multiple columns.    But if I have a set of duplicate rows how do I / how does SQL Server decide which to remove? And how would I force it to remove all but the one with the highest IDENTITY value?  EMPLOYEE_ID     ATTENDANCE_DATE     AUTOID A001            2011-01-01          1 A001            2011-01-01          2   If I would run the query now it happens to remove the second one, with AUTOID 2. But I am trying to remove all but this one (because this is the one latest added). How to unselect Excel Cell using Keyboard Shortcut? One can select multiple Excel cells (either contiguously or not) using the keyboard shortcut Ctrl+Click.   How do you deselect one or more of these previously-selected cells? $f(z)=\frac{z}{1+|z|} $ Is 1-1? Zero integral of measurable $f$ on every interval implies $f=0$? Let $f:\mathbb{R} \rightarrow \mathbb{R}$ be a Borel measurable function, such that $\displaystyle \int_{a}^{b}f(x)dx=0$ for every $a&lt;b$ in $\mathbb{R}.$ Is it true that $f(x)=0$ for every $x\in \mathbb{R}$?  Comments: the starting point of this is to prove that the (Borel measurable) density function $f$ (if exists) of a symmetric random variable $X$ (meaning that $X,~-X$ have common cdf's) is even. If my question has a positive answer, it follows easily.   Thanks a lot for any comments! Getting hyperref to work with \citeyear and \citeyearpar in biblatex Irreducibility of $p(x)=x^4-4x^2+8x+2$ over $\mathbb{Q}(\sqrt{-2})$- Dummit Foote Abstract algebra $9.4.10$