I have a company, industry, and company_industry_map many-to-many table.    company_id | company_name 1            Goldman Sachs 2            Microsoft  industry_id | industry 4             Technology 5             Finance 6             Banking  company_id | industry_id 1            5 1            6 2            4   I'd like to write a query that joins all of the industries into a comma separated list like this:  company_id | industries 1            Finance, Banking 2            Technology   Here's my general query that I'm trying to write:  SELECT company_id,         xxx AS industries    FROM company c,         company_industry_map m   WHERE c.company_id = m.company_id
To illustrate, assume that I have two tables as follows:  VehicleID Name 1         Chuck 2         Larry  LocationID VehicleID City 1          1         New York 2          1         Seattle 3          1         Vancouver 4          2         Los Angeles 5          2         Houston   I want to write a query to return the following results:  VehicleID Name    Locations 1         Chuck   New York, Seattle, Vancouver 2         Larry   Los Angeles, Houston   I know that this can be done using server side cursors, ie:  DECLARE @VehicleID int DECLARE @VehicleName varchar(100) DECLARE @LocationCity varchar(100) DECLARE @Locations varchar(4000) DECLARE @Results TABLE (   VehicleID int   Name varchar(100)   Locations varchar(4000) )  DECLARE VehiclesCursor CURSOR FOR SELECT   [VehicleID] , [Name] FROM [Vehicles]  OPEN VehiclesCursor  FETCH NEXT FROM VehiclesCursor INTO   @VehicleID , @VehicleName WHILE @@FETCH_STATUS = 0 BEGIN    SET @Locations = ''    DECLARE LocationsCursor CURSOR FOR   SELECT     [City]   FROM [Locations]   WHERE [VehicleID] = @VehicleID    OPEN LocationsCursor    FETCH NEXT FROM LocationsCursor INTO     @LocationCity   WHILE @@FETCH_STATUS = 0   BEGIN     SET @Locations = @Locations + @LocationCity      FETCH NEXT FROM LocationsCursor INTO       @LocationCity   END   CLOSE LocationsCursor   DEALLOCATE LocationsCursor    INSERT INTO @Results (VehicleID, Name, Locations) SELECT @VehicleID, @Name, @Locations  END      CLOSE VehiclesCursor DEALLOCATE VehiclesCursor  SELECT * FROM @Results   However, as you can see, this requires a great deal of code.  What I would like is a generic function that would allow me to do something like this:  SELECT VehicleID      , Name      , JOIN(SELECT City FROM Locations WHERE VehicleID = Vehicles.VehicleID, ', ') AS Locations FROM Vehicles   Is this possible?  Or something similar?
Solve $\lim_{x\to 0} \frac{\sin x-x}{x^3}$ How to call child component controller function/helper from Parent Component Controller I have requirement to call a child controller function from parent controller whenever the event occurs in parent side.  for e.g  ABC is parent component and DCE is child component, this child component has Span of Text tag and X symbol. when I click on x it is clearing the value using child controller. ABC parent component has Form element and child component is one one of in form.  My requirement is to clear the this child component value when parent component button is clicked.  here is the below sample code of what am trying because i cannot post actual code here  ParentComponent.cmp     &lt;aura:registerEvent name="clrValues" type="c:ClearValues"/&gt;     &lt;div&gt;          &lt;c:ChildComponent textValue="test"/&gt;          &lt;ui:button label="Save"/&gt;          &lt;ui:button label="Clear" press="{!c.clear}"/&gt;           &lt;/div&gt;  &lt;/aura:component&gt;   ParentController.js  ({     clear : function(component, event, helper) {         var evtFire = component.getEvent("clrValues");          evtFire.fire();     } })   ClearValues.evt  &lt;aura:event type="APPLICATION" description="Event template" /&gt;   ChildComponent.cmp  &lt;aura:component &gt;     &lt;aura:handler name="setValues" event="c:ClearValues" action="{!c.clear}"/&gt;     &lt;aura:attribute name="textValue" type="String" default="test"/&gt;     &lt;div &gt;     &lt;ui:inputText label="Expense Name" value="{!v.textValue}" aura:id="input1"/&gt;     &lt;/div&gt;  &lt;/aura:component&gt;   ChildController.js  ({     clear : function(component, event, helper) {         helper.clearValues(component,event);     } }) "Basis extension theorem" for local smooth vector fields How does asymmetric encryption work? I've always been interested in encryption but I have never found a good explanation (beginners explanation) of how encryption with public key and decryption with private key works.  How does it encrypt something with one key and decipher it with another key? Unix Truncate Column in csv file Movie with "Where do the tubes go?" I'm trying to find a movie with an underground facility with people wearing white suits. The people have been affected such that they show no curiosity. There is one person that does and asks one of his co-workers where a tube leads to.      At the end there is an uprising where everyone gets to see the surface and sunlight.   What is the name of this movie? i'm surprised there is so little documentation on this issue. But i'm trying to duck the audio on all the mix buses in Unity so that you can clearly hear the VO of the game.  Now it works great except that I have some reverb zones in the game and any sound that plays in these reverb zones, the actual reverb itself is NOT DUCKED.  So the VO is accompanied with a huge wall of wishy washy muddy noise.  Anyone deal with this before? How can we deal with this? Before asking my question, I'll use an example to clarify the idea.  Say that a company used to sell horses and then they turn into a sheeps business. While some of the old pages can be mapped to the new pages using a 301 redirect, because they're really related in the content and the company don't want to lose users and link juice, there are a lot of pages strictly related to horses that they want to shutdown.  What's the best practice? Is there a way to say to users and Search Engines the content you were looking for won't be available any more?  Basically a 301 redirect of the closed pages to new ones seems not so good, because you'll show a content totally unrelated to the searched one.  P.S: I'm aware that probably the best fallback is to simply map those pages to the homepage but I hope in a smarter solution. Line of Bones to Travel and Conform to Curve (Train or snake following path) I've searched google extensively on this. Can't seem to find an answer.   I know about spline IK, which is wonderful for conforming a row of bones to a path. But combining the armature object with a follow path modifier causes the point of origin to move, but the bones themselves stick to the beginning of curve.   Ultimately my goal is to make a creature like a snake or centipede follow a curve path, thus animating it fairly realistically ... How to sum $\sum_{x=0}^{N-1} \cos{\left( \frac{2\pi x}{N} \right)}^{2}$? I've tried solving it, but I'm not familiar with these kind of progressions and I couldn't get to a result. Also, I've found that the result is just $N/2$, but I don't get why would that be the answer, as it doesn't work for $N=1$ or $N=2$. Appreciate your help :) Choosing the best model from among different "best" models How do you choose a model from among different models chosen by different methods (e.g. backwards or forwards selection)?  Also what is a parsimonious model? In Finder when I type something in the textbox the default is to search the whole mac in the contents of the files. I was able to change the default to search the current directory, but didn't see an option to change search for contents to search for file name. How can that be changed? Print xml with php How to configure a firewall that only allows a few webpages and dropbox and U1 services? How do you photograph rain? What are recommended settings for my Nikon Coolpix P1 to best portray rain?  Here's what I got. No retouching was applied.   The picture I took when the rain was heavy with the automatic settings:  The picture I took with the "Sports" program; by then, however, the rain was not as hard. Ugh, ugly gray strip at the bottom, that was the flat surface I put my camera on to get a stable picture.   My main problem is that the actual rain and hailstorm is very hard to see in the picture. The overall effect is, instead, of fog.    Follow-up from the thread, courtesy of more rain, now with less hailstorm and more thunder.  The feedback amounted to flash and faster shutter. I took a few photos and I'm having some trouble to reconstruct what I did to get each result. Two representative results:   Fast shutter, with some guest starring:I'm talking about that horrible building obviously. Faster shutter and flash:Kinda difficult to say those pictures were taken sixty seconds of each other. :)   I'm not sure, however, that either of this is really an improvement of the original results. Why can't I install iOS 9.3? I saw an update for my iOS 9.2.1 device to iOS 9.3.  However, it said that the update cannot be verified, although it was downloaded.  I even deleted all data and applications from the device, but I still cannot update the device to 9.3; it just says "Your software is up to date" on iOS 9.2.1.  Can you force an update to 9.3? Akhil showed that the  is the same as the continuum, using as a step the observation that continuous functions that agree at rational points must agree everywhere, since the rationals are dense in the reals.  This isn't an obvious step, so why is it true? I am comfortable with the different sizes of infinities and Cantor's "diagonal argument" to prove that the set of all subsets of an infinite set has cardinality strictly greater than the set itself. So if we have a set $\Omega$ and $|\Omega| = \aleph_i$, then (assuming continuum hypothesis) the cardinality of $2^{\Omega}$ is $|2^{\Omega}| = \aleph_{i+1} &gt; \aleph_i$ and we have $\aleph_{i+1} = 2^{\aleph_i}$.  I am fine with these argument.  What I don't understand is why should there be a smallest $\infty$? Is there a proof (or) an axiom that there exists a smallest $\infty$ and that this is what we address as "countably infinite"? or to rephrase the question "why can't I find a set whose power set gives us $\mathbb{N}$"?  The reason why I am asking this question is in "some sense" $\aleph_i = \log_2(\aleph_{i+1})$. I do not completely understand why this process should stop when $\aleph_i = \aleph_0$.  (Though coming to think about it I can feel that if I take an infinite set with $\log_2 \aleph_0$ elements I can still put it in one-to-one correspondence with the Natural number set. So Is $\log_2 \aleph_0 = \aleph_0$ (or) am I just confused? If $n \rightarrow \infty$, then $2^n \rightarrow \infty$ faster while $\log (n) \rightarrow \infty$ slower and $\log (\log (n)) \rightarrow \infty$ even slower and $\log(\log(\log (n))) \rightarrow \infty$ even "more" slower and so on).  Is there a clean (and relatively elementary) way to explain this to me?  (I am totally fine if you direct me to some paper (or) webpage. I tried googling but could not find an answer to my question) Is doing two PhDs a good path? I am studying a combined bachelor of engineering (electrical) and bachelor of mathematics; I just started this year and will graduate in 2018. The reason why I am doing double degrees and not a single degree is because I love both electrical engineering and mathematics and I could not ignore any of them. So with this in mind, I am thinking of doing two PhDs when I graduate (one in electrical engineering and one in mathematics). Is this a good path or I should concentrate on only one of them? In Java, you can qualify local variables and method parameters with the final keyword.  public static void foo(final int x) {   final String qwerty = "bar";  }   Doing so results in not being able to reassign x and qwerty in the body of the method.  This practice nudges your code in the direction of immutability which is generally considered a plus. But, it also tends to clutter up code with "final" showing up everywhere. What is your opinion of the final keyword for local variables and method parameters in Java?