
104 Cal.Rptr.2d 903 (2001)
87 Cal.App.4th 933
Rolando CALDERON, Petitioner,
v.
The SUPERIOR COURT of Los Angeles County, Respondent;
The People, Real Party in Interest.
No. B143933.
Court of Appeal, Second District, Division Four.
March 9, 2001.
*904 Joseph A. Gutierrez, Montebello, for Petitioner.
No appearance on behalf of Respondent.
Gil Garcetti, District Attorney, Patrick D. Moran and Phyllis C. Asayama, Deputy District Attorneys for Real Party in Interest.
EPSTEIN, J.
The petitioner and a codefendant are charged with two counts of premeditated attempted murder. In a separate criminal proceeding arising out of a different episode, the codefendant and another person were charged with the execution-style murder of one person and attempted murder of another. The cases were consolidated, so that the charges against the petitioner are to be tried together with all charges against the codefendant. (Charges against the other person in the second episode were severed.) We granted an alternative writ to determine whether the consolidation presented, a serious prospect of unfair prejudice to the petitioner, so that the prosecution's motion to consolidate should have been denied. We conclude that under the facts presented, the likelihood of such prejudice has been shown. We shall order the trial court to vacate its order arid deny the motion to consolidate.

FACTUAL AND PROCEDURAL SUMMARY
Our summary of the facts relating to the charges in which both the petitioner and the codefendant are involved, which we refer to as the July 18 episode, is taken from the felony preliminary hearing at which both were held to answer. We have not been furnished a transcript of the preliminary hearing for the other charges, which arose from what we refer to as the July 1 episode. We take our summary of those facts from the summaries in the petition and the prosecutor's opposition, which are in essential agreement.
The petitioner is Rolando Calderon. The charges against him and his codefendant, Ever Rivera, arise out of a violent encounter in Los Angeles on July 18, 1999. In the early morning hours of that day two young men, Joe Young and Byron Sylvester, were walking near the intersection of Kester and Valerio in the San Fernando Valley area of Los Angeles. They went behind some bushes to urinate. While there, they heard a car approach with music playing. Thinking there might be women in the car, the young men walked in its direction. There were two men in the car, a red Honda, but no women. The passenger made a rude gesture toward Young and Sylvester, which they returned. Shortly after that the Honda made a U-turn and came back to where Young and Sylvester were standing.
When the car came to a stop a man exited from the passenger side. Young ducked behind another car and Sylvester ran away. Upon exiting, the passenger immediately began firing a pistol toward Sylvester. Young stood up and yelled for *905 Sylvester to run, and was himself shot at by the passenger as he ran away. Both Sylvester and Young were struck. Sylvester was shot in the chest and seriously wounded. After firing the shots, the passenger got back into the car, which drove off.
Young identified Rivera to police as the passenger who had exited the vehicle and shot both men. The identification was from a photo lineup. Young recanted his identification at the preliminary hearing, but did so, he said, because he was forgiving and did not want to be responsible for having someone locked up for a long time. Young never identified the driver of the car.
When the car came to a stop, after executing the U-turn, the passenger door was facing the two men, so that the driver's side was opposite where they were standing. Sylvester testified that Rivera was the passenger who exited the car, walked in his direction, and shot at both men. He testified that Calderon was the driver. He also had identified Rivera and Calderon to police from photographs. Sylvester stated that the entire episode occurred within seconds, that he was angry and scared at the time, that it was dark and there was no nearby street light on his side of the street, and that he caught only a glimpse of the driver when the inside of the vehicle was illuminated upon Rivera's opening the passenger door. Sylvester was some 30 feet away from the vehicle when he started to run. He had been partying and drinking beer earlier in the evening. He was on felony probation at the time.
According to the District Attorney's motion to consolidate, the other episode occurred some two weeks before, on July 1, 1999. Early in the morning of that day, two men, Daniel Vilchis and Cesar Soria, were selling crack cocaine from behind the security gate of an apartment house. Alex Hluz approached and demanded money from Vilchis and Soria. The demand was refused, and Hluz was challenged to fight. He declined and went away.
Hluz returned later that morning with Rivera and a third man. This time Hluz pointed a gun at Vilchis and Soria and ordered them to open the security gate, which they did. Hluz then ordered Vilchis and Soria to lay on the ground. Vilchis complied immediately. Soria knelt down, but too slowly, and he was shot in the arm by Hluz. Hluz then killed Vilchis by a gunshot to the back of his head. Rivera took jewelry and money from Soria, saying "That's what happens when you mess with my homeboy." Soria managed to jump up and run away. Hluz fired at him, but missed. Soria later identified both Hluz and Rivera from photographs. Soria had seen Rivera buying drugs from Vilchis on several earlier occasions during the four weeks before the murder. Hluz had driven Rivera to the neighborhood.
Both Hluz and Rivera admitted that they accosted the victims, robbing them, and that Hluz shot Vilchis in the back of the head and shot Soria in the arm. The third man in the episode was not apprehended or identified.
Two separate prosecutions were brought by the District Attorney. One charged Calderon and Rivera with two counts of premeditated attempted murder arising out of the July 18 episode. The other charged Rivera and Hluz with murder and attempted murder arising out of the July 1 episode. In both sets of charges, the criminal street gang enhancement was alleged. (Pen.Code, § 186.26; all further statutory references are to that code unless another is identified.) The prosecution moved to sever the charges against Hluz, so that he and Rivera would be tried separately. This was due to confessions by each defendant that implicated the other. (See People v. Aranda (1965) 63 Cal.2d 518, 530, 47 Cal.Rptr. 353, 407 P.2d 265.) At the same time, the prosecution moved to consolidate the charges against Rivera arising from the July 1 episode with those against Rivera and Calderon arising out of the *906 July 18 episode. During argument on the motion to consolidate, the People offered to stipulate that Calderon was not involved in the July 1 episode. The motion to sever, which was unopposed, was granted. The motion to consolidate was granted over Calderon's opposition, leading to Calderon's petition, which we now review.

DISCUSSION
"When two or more defendants are jointly charged with any public offense, whether felony or misdemeanor, they must be tried jointly, unless the court order separate trials." (§ 1098.) This rule, enacted in 1921, abrogated a previous rule that gave defendants an absolute right to separate trials, a rule that itself abrogated the common law that preceded it. (People v. Massie (1967) 66 Cal.2d 899, 916, 59 Cal.Rptr. 733, 428 P.2d 869.) Under this statute, the trial court exercises discretion in deciding whether to order separate trials or not. (People v. Greenberger (1997) 58 Cal.App.4th 298, 343, 68 Cal.Rptr.2d 61, and authorities cited.) The test of error on an appeal challenging an order denying severance is whether the trial court abused its discretion. (People v. Boyde (1988) 46 Cal.3d 212, 231, 250 Cal.Rptr. 83, 758 P.2d 25, overruled on another point sub nom. Boyde v. California (1990) 494 U.S. 370, 110 S.Ct. 1190, 108 L.Ed.2d 316.) Generally speaking, the legislative preference is for joint trials. (See People v. Lara (1967) 67 Cal.2d 365, 394, 62 Cal.Rptr. 586, 432 P.2d 202; People v. Boyde, supra, 46 Cal.3d at p. 231, 250 Cal.Rptr. 83, 758 P.2d 25.)
In Massie, a leading case, the Supreme Court identified several factors for trial court consideration when presented with a motion for separate trials of codefendants: an incriminating confession that prejudicially associates codefendants; prejudicial association with codefendants; likely confusion from evidence on multiple counts; conflicting defenses; and the possibility that at a separate trial a codefendant would give exonerating testimony. (People v. Massie, supra, 66 Cal.2d at p. 917, 59 Cal.Rptr. 733, 428 P.2d 869; see People v. Boyde, supra, 46 Cal.3d at p. 232, 250 Cal.Rptr. 83, 758 P.2d 25 [reiterates Massie factors].) No case has held that these factors are exclusive, and almost all of the multi-defendant cases involve defendants who are charged with crimes arising out of the same episode, rather than on separate occasions. (See, e.g., People v. Turner (1984) 37 Cal.3d 302, 208 Cal.Rptr. 196, 690 P.2d 669, overruled on other grounds in People v. Anderson (1987) 43 Cal.3d 1104, 1115, 240 Cal.Rptr. 585, 742 P.2d 1306; People v. Boyde, supra, 46 Cal.3d 212, 250 Cal.Rptr. 83, 758 P.2d 25.) The analysis is somewhat different when, as in this case, crimes arising out of separate episodes are alleged. In that case, the issues are closer to those encountered under section 954 (joinder of counts).
In its opposition to Calderon's petition, the prosecution quotes a statement in Williams v. Superior Court (1984) 36 Cal.3d 441, 447, 204 Cal.Rptr. 700, 683 P.2d 699: "`"[W]here the consolidation meets the test of joinder," ... "the difficulty of showing prejudice from denial of severance is so great that the courts almost invariably reject the claim of abuse of discretion."' [Citation.]" The opposition fails to refer to the Supreme Court's statement on the next page: "Such language, however, overstates the issue. We clearly do not wish to imply that principles of justice will never compel severance of charges or that appellate courts should never undertake to review a trial court's exercise of discretion in denying a party's motion to sever. Put simply, the joinder laws must never be used to deny a criminal defendant's fundamental right to due process and a fair trial." (36 Cal.3d at p. 448, 204 Cal.Rptr. 700, 683 P.2d 699; see also Belton v. Superior Court (1993) 19 Cal.App.4th 1279, 1285, 24 Cal.Rptr.2d 34 [Pen.Code, § 954.1, and Cal. Const., art. I, § 30, added by initiative in 1990, do not abrogate Williams].)
*907 Laying to one side the fact that this case involves a prosecutor's motion to consolidate rather than a defense motion to sever, and that it arises in the context of a pre-trial motion (before the expense of a lengthy and expensive trial) rather than an assessment of prejudice after the fact, the Supreme Court's concern that the defendant receive a fair trial is the essence of the issue presented by the present petition.
In making that assessment, we find the decision in People v. Marshall (1997) 15 Cal.4th 1, 27, 61 Cal.Rptr.2d 84, 931 P.2d 262 instructive. In that case, which involved joinder of counts under section 954, our Supreme Court set out four criteria to guide trial court discretion: (1) whether evidence of the crimes would be cross-admissible; (2) whether some charges are likely to inflame the jury against the defendant; (3) whether a weak case has been joined with a strong one, or with another weak case; and (4) whether any of the charges is a potentially capital offense.
The first three of these factors counsel against joinder, and even the last is arguable on that issue. We consider them in order.
(1) Cross-admissibility. With a single exception, none of the evidence concerning the July 1 episode is admissible against Calderon. Each episode was separate and occurred in a very different factual setting. There is no indication that any of the other crimes factors identified in Evidence Code section 1101, subdivision (b) might apply to allow evidence of the July 1 episode to be used against Calderon. In fact, as we have seen, the prosecution is prepared to stipulate that Calderon was not involved in the crimes occurring on that date. We assume the jury would be so instructed and would be presumed to follow the instruction.
The exception concerns the gang allegation and the proof that may be expected to substantiate it. There is evidence that both Calderon and Rivera are active members of Mara Salvatrucha. According to a police expert who testified at the preliminary hearing on the July 18 episode, this is a very large gang, having some 4,700 members in Los Angeles County. The prosecution has alleged it is a criminal street gang, within the definition of section 186.22. To satisfy that definition, the gang must engage in a "pattern of criminal gang activity." That requires "the commission of, attempted commission of, or solicitation of, ... or conviction of two or more" listed offenses within a specified period, by two or more persons. The listed crimes upon which the prosecution has indicated it intends to rely are robbery, unlawful homicide or manslaughter, and possession of a concealable firearm in violation of section 12021, subdivision (a). (§ 186.22, subd. (e).) The statute also requires that the organization have, as a primary activity, use of a common name, sign or symbol, and that its members must "individually or collectively engage in or have engaged in a pattern of criminal gang activity." (§ 186.22, subd. (f).)
In the trial court and in response to our alternative writ, the prosecution has argued that it will attempt to demonstrate that all crimes in each episode were committed for the benefit of the Mara Salvatrucha gang. Calderon, in his petition, has offered to stipulate that Mara Salvatrucha is a criminal street gang within the meaning of the statutory definition. The prosecution has responded, correctly, that this offer is unavailing because the correctness of the trial court's ruling must be judged by the evidence and argument before it at the time, and Calderon made no such offer then. (See People v. Marshall, supra, 15 Cal.4th at p. 27, 61 Cal.Rptr.2d 84, 931 P.2d 262; People v. Turner, supra, 37 Cal.3d at p. 313, 208 Cal.Rptr. 196, 690 P.2d 669; People v. Alvarado (1967) 255 Cal.App.2d 285, 289, 62 Cal.Rptr. 891.)
As Calderon has pointed out, and as the prosecution has acknowledged, the qualifying felonies for the criminal street gang *908 enhancement can be proved by the evidence in the July 18 episode without proof of any other crimes. The prosecution responds that this does not mean that it should be proven that way-it would have stronger proof if evidence of both episodes were before the jury. This is so, but it points up the problem of prejudice that joinder presents. Obviously, Calderon cannot be prosecuted as an aider and abettor of the July 1 murder and attempted murder merely because he is a member of the same gang as Rivera. The street gang allegations may allow evidence of that episode to be received in a trial of the July 18 episode, because both men are members of the same gang. But that is a far cry from the effect of proving the July 1 crimes to a jury trying both Rivera and Calderon. Application of the criminal street gang statute is likely to undermine the effect of any stipulation with respect to the July 1 episode as to Calderon. The jurors would be remarkable indeed to be able to avoid improperly allocating responsibility for those crimes to Calderon.
(2) Inflaming the jury. The crimes committed in both episodes are heinous. But the July 18 episode, bad as it is, arose out of exchanged insults* with the implication of a challenge. The second involved a gratuitous shooting of one victim in the arm and, worst of all, the execution-style murder of the other when Hluz shot Vilchis, who was kneeling, in the back of his head. One would have to be almost saintly not to be aroused by such evidence.
(3) Combining strong case with weak case, or two weak cases. Given the evidence of a confession and the strong identification of Rivera as a participant in the July 1 episode, the case against him is strong. It is not as strong with respect to the July 18 episode, but one of the victims of the crimes committed on that occasion identified Rivera to police, and the other identified him by testimony at the preliminary hearing. But the evidence against Calderon may fairly be characterized as weak. One victim, Young, did not identify him at all. The other, Sylvester, got only a fleeting glimpse of the driver of the Honda. He was facing the passenger side of the car, and the glimpse he had was in the stress of seeing the passenger exit the vehicle and immediately begin shooting at his companion, and then, at him. This was in the dark of night while Sylvester was, understandably, scared and angry. (There is nothing in the preliminary hearing transcript indicating any other tie-in of Calderon with the Honda used in the July 18 episode.) This is, as to Calderon, the combination of a weak case (his) with a strong one (the July 1 episode against Rivera).
(4) Capital case. The prosecution is not seeking the death penalty against Rivera (or Hluz) with respect to the July 1 episode. We note, however, that the facts we have about that matter indicate that it qualifies as a special circumstance case based on a murder committed in the course of a robbery. (§ 190.2, subd. (a)(17)(A).)
Taken together, these circumstances demonstrate undue prejudice to Calderon in being forced to join Rivera as a codefendant in a trial at which Rivera is charged with premeditated murder based on an entirely separate episode. We conclude, in the circumstances of the case, that the trial court abused its discretion in granting the motion to consolidate.

DISPOSITION
Let a writ issue commanding the trial court to vacate its earlier order granting the prosecution's motion to consolidate, and to issue a new and different order denying that motion so that, if Calderon and Rivera are tried together, the charges against Rivera arising from the July 1, 1999 episode will not be tried in the same case.
CHARLES S. VOGEL, P.J., and CURRY, J., concur.
