I have two tables, logically related one to many.  First table:  CREATE TABLE Persons  (     ID int NOT NULL PRIMARY KEY,     LastName varchar(255) NOT NULL,     FirstName varchar(255),      Age int );   Second table:  CREATE TABLE Vehicles  (     Brand varchar(50),      PersonID int,      FOREIGN KEY(PersonID) REFERENCES Persons(ID) );   My approach is to list each of the Persons and the vehicles that this Person own.   What I managed to do:  SELECT LastName, brand  FROM vehicles INNER JOIN Persons ON Persons.ID = PersonID ORDER BY LastName ASC   Unfortunately this is not what I have in mind to do, which is to display every Person once and next to it a list of vehicles for ex.:  User1 | kia, ford, jeep User2 | ferrari, harley   Is it doable and if so what is the appropriate way? Any help is welcome!
I'm trying to migrate a MySQL-based app over to Microsoft SQL Server 2005 (not by choice, but that's life).  In the original app, we used almost entirely ANSI-SQL compliant statements, with one significant exception -- we used MySQL's group_concat function fairly frequently.  group_concat, by the way, does this: given a table of, say, employee names and projects...  SELECT empName, projID FROM project_members;   returns:  ANDY   |  A100 ANDY   |  B391 ANDY   |  X010 TOM    |  A100 TOM    |  A510   ... and here's what you get with group_concat:  SELECT      empName, group_concat(projID SEPARATOR ' / ')  FROM      project_members  GROUP BY      empName;   returns:  ANDY   |  A100 / B391 / X010 TOM    |  A100 / A510   So what I'd like to know is: Is it possible to write, say, a user-defined function in SQL Server which emulates the functionality of group_concat?   I have almost no experience using UDFs, stored procedures, or anything like that, just straight-up SQL, so please err on the side of too much explanation :)
What is an example of pairwise independent random variables which are not independent? I've just read in a stochastics textbook:     Let $(\Omega, P)$ be a discrete probability space.      (a) The events $A_i \subseteq \Omega, i=1,2, \dots$ are called independent, if   $$P(A_{i_1} \cap A_{i_2} \cap \dots \cap A_{i_k}) = P(A_{i_1}) \cdot \dots \cdot A_{i_k}$$   for all finite sets $\{i_1, \dots, i_k\} \subsetneq \{1,2, \dots\}$ and all $k \geq 2$.      (b) The events $A_i \subseteq \Omega, i=1,2,\dots$ are called pairwise independent, if   $$P(A_{i_1} \cap A_{i_2}) = P(A_{i_1}) \cdot P(A_{i_2})$$   for all pairs $\{i_1, i_2\} \subsetneq \{1,2,\dots\}$.   After these two definitions it states that pairwise independent events are not always independent.  Do you have an example? The use of “So X as to be Y” First of all, note that this is not a duplicate question of another one asking about the usage of so as to, since this one is asking about the structure of so . . . as to. . . .  I understand this might have been a better question at the , since I’m not a native English speaker. I am asking it here since I want to get some professional advice in regard to this question, since I don’t seem to have found anything similar to this on the Internet.  At the Oxford Dictionaries Online (OD) I have found the following definition of ludicrous:     So foolish, unreasonable, or out of place as to be amusing.   I understand the phrase so as to, simply meaning in order to and preceding the purpose for which an action is done.  So by itself is just therefore, hence, thus, or a way of emphasizing an adjective or adverb.  As to in itself means with regard to or according to, as pointed out in .  In the OD definition of ludicrous, the use of so looks fair to me, that is, it clearly emphasizes the high extent to which something is foolish or unreasonable.  The use of as to doesn’t work in any way I’ve mentioned in this case (neither as in with regard to nor according to). I think the dictionary I’ve referred to has missed one, if not more, meaning of the phrase as to.  In this case, it appears to have likely been used as an alternative to that when used in the form So X, that Y, meaning something is or happens X (a combination of adjectives or adverbs) enough to cause Y to happen.  Of course, I don’t mean that in the structure so X as to Y the phrase as to is absolutely equivalent to that, since substituting as to with that changes the structure of Y.  Does all this mean that the phrase as to is a great alternative to that (although changing the structure of Y) whenever the sentence is of the form so X, that Y (where X is a combination of one or more adjectives or adverbs)?  I am new here and so I’m not too familiar with the variety of existing tags here, so if anyone sees an additional one that would fit, please add it to this question. I would also be glad to see some other corrections of my grammar. How do I activate Dauntless Cathar's ability? has the following ability:     {1}{W}, Exile Dauntless Cathar from your graveyard: Put a 1/1 white Spirit creature token with flying onto the battlefield. Activate this ability only any time you could cast a sorcery.   Please clarify. If the card is IN my hand, how can I exile if FROM the graveyard if it is not there? Did the writers mean SEND it to graveyard, or actually exile it? Confused, the writing does not make sense. I am unable to understand what exactly is critical value.My question here is why do we fail to reject a null hypothesis when the test statistic is within the range of critical value.  What i am trying to ask is what is the property of the critical value that makes the hypothesized value to fall within the range implied by the critical value.  Thanks in advance SHM with acceleration at mean position Suppose we have an equation of  motion as $$\frac{d^2x}{dt^2} = -kx + c,$$ then can it be called a SHM? Since acceleration is still proportional to displacement. But then, how will we define the mean position? How can I install WhatsApp in Ubuntu? Related: What is the scope of variables in JavaScript? What is the scope of variables in javascript? Do they have the same scope inside as opposed to outside a function? Or does it even matter? Also, where are the variables stored if they are defined globally? How do I have no default web browser, so the system asks what browser to use when I click on a link? I use Internet Explorer for some things and Chrome for others. I'd like to have a choice when I click on a link of which browser to open the link in. Is this possible in Windows? I am currently running Windows 8, although there should be similarities between versions.  To the best of my knowledge this isn't possible. Show that the set $\mathbb{Q}[\sqrt{2}] = \{a + b \sqrt{2} \mid a, b \in \mathbb{Q}\}$ is a field with the usual multiplication and addition. Expected number of rolling a pair of dice to generate all possible sums A pair of dice is rolled repeatedly until each outcome (2 through 12) has occurred at least once. What is the expected number of rolls necessary for this to occur?  Notes: This is not very deep conceptually, but because of the unequal probabilities for the outcomes, it seems that the calculations involved are terribly messy.  It must have been done already (dice have been studied for centuries!) but I can't find a discussion in any book, or on line. Can anybody give a reference? How can I initialise a static Map? How would you initialise a static Map in Java?  Method one: static initialiser  Method two: instance initialiser (anonymous subclass) or some other method?  What are the pros and cons of each?  Here is an example illustrating the two methods:  import java.util.HashMap; import java.util.Map;  public class Test {     private static final Map&lt;Integer, String&gt; myMap = new HashMap&lt;&gt;();     static {         myMap.put(1, "one");         myMap.put(2, "two");     }      private static final Map&lt;Integer, String&gt; myMap2 = new HashMap&lt;&gt;(){         {             put(1, "one");             put(2, "two");         }     }; } How to perform two-sample t-tests in R by inputting sample statistics rather than the raw data? Let's say we have the statistics given below  gender mean sd n f 1.666667 0.5773503 3 m 4.500000 0.5773503 4   How do you perform a two-sample t-test (to see if there is a significant difference between the means of men and women in some variable) using statistics like this rather than actual data?  I couldn't find anywhere on the internet how to do this. Most of the tutorials and even the manual deal with the test with the actual data set only. How to search for email of a particular date from years ago in Gmail There are similar questions and several answers. I tried to follow the methods provided in the answers.  They did not work. So I am going to ask it again with more specifics.  I only knew the date of the email in the in-box in 2012 and the content of it but did not know the exact wording of the subject. Is it possible to find this email? Remove extra header lines from file, except for the first line I have a file that looks like this toy example.  My actual file has 4 million lines, about 10 of which I need to delete.  ID  Data1  Data2 1    100    100 2    100    200 3    200    100 ID  Data1  Data2 4    100    100 ID  Data1  Data2 5    200    200   I want to delete the lines that look like the header, except for the first line.  Final file:  ID  Data1  Data2 1    100    100 2    100    200 3    200    100 4    100    100 5    200    200   How can I do this? How to forbid keyboard shortcut stealing by websites in Firefox Many websites, especially everything involving rich text editing (this site is guilty as well), steal keyboard shortcuts normally used to control Firefox and make them do something else instead. It is totally infuriating when I press something like Cmd-number, Cmd-L, Cmd-T, or Cmd-K and it doesn't do what I want it to. Can I make it stop?  Actually, it would probably be for the best if I could forbid stealing of all Cmd-* shortcuts. I've never seen them used for anything useful. Is it possible? Is this sentence acceptable?     You’re welcome, have a nice day ahead. Do we have different badges in different SE sites Exponential of the differential operator I am not sure whether this question is even well-posed. But today I learnt that $e^Df(x) = f(x+1)$ where $D$ is differential operator and  $$e^D \triangleq \sum_{i=0}^{\infty} \frac{D^i}{i!}.$$  (ref. )  So I was curious as to whether the differential equation  $$\frac{df(t)}{dt} = e^Df(t) = f(t+1)$$  has any solutions apart from $f = 0$? I have a Minecraft 1.8.1 vanilla server and would like to reward certain users. I would like to /give some users a 99999/99999 durability renamed Diamond Pickaxe (with all enchantments on it). How do I use commands to change/repair the durability of items? If possible, using only one command and use /give. I have a nominal variable (different topics of conversation, coded as topic0=0 etc) and a number of scale variables (DV) such as the length of a conversation.   How can I derive correlations between the nominal and scale variables?