How to get the PC models with identical speed? I am trying to get pairs of PC models with identical speeds and the same RAM capacity. Each resulting pair should be displayed only once, i.e. (i, j) but not (j, i). 

Result required as : model with the bigger number, model with the smaller number, speed, and RAM. The result I am expecting is

╔═══════╦═══════╦═══════╦═════╗
║ model ║ model ║ speed ║ ram ║
╠═══════╬═══════╬═══════╬═════╣
║  1233 ║  1121 ║   750 ║ 128 ║
║  1233 ║  1232 ║   500 ║  64 ║
║  1260 ║  1232 ║   500 ║  32 ║
╚═══════╩═══════╩═══════╩═════╝


and table structure is 

╔═══════╦═══════╦═════╗
║ model ║ speed ║ ram ║
╠═══════╬═══════╬═════╣
║  1121 ║   600 ║ 128 ║
║  1121 ║   600 ║ 128 ║
║  1121 ║   750 ║ 128 ║
║  1232 ║   450 ║  32 ║
║  1232 ║   450 ║  64 ║
║  1232 ║   500 ║  32 ║
║  1232 ║   500 ║  64 ║
║  1233 ║   500 ║  64 ║
║  1233 ║   750 ║ 128 ║
║  1233 ║   800 ║ 128 ║
║  1233 ║   900 ║ 128 ║
║  1260 ║   500 ║  32 ║
╚═══════╩═══════╩═════╝


The query I am trying is this and I am using MySQL

select pca.model, pcb.model, pca.speed, pca.ram 
from pc pca 
where pca.speed in (
    select pcb.speed 
    from pc pcb 
    where pca.speed = pcb.speed
);
This should do the trick:

select distinct 
  pca.model, pcb.model, pca.speed, pca.ram
from pc pca 
join pc pcb 
  on (pca.speed = pcb.speed 
  and pca.ram = pcb.ram 
  and pca.model &gt; pcb.model)