02/09/2011, 16:29
|
| | | Fecha de Ingreso: diciembre-2010 Ubicación: México
Mensajes: 227
Antigüedad: 14 años Puntos: 10 | |
Respuesta: Crear una matriz en MySQL Algunas soluciones:
-Ver los registros de las tablas pesos y tallas:
select peso,talla from pesos inner join tallas;
+------+-------+
| peso | talla |
+------+-------+
| 45 | 1.5 |
| 45 | 1.53 |
| 45 | 1.56 |
| 45 | 1.59 |
| 45 | 1.62 |
| 45 | 1.65 |
| 45 | 1.68 |
| 45 | 1.71 |
| 45 | 1.74 |
| 45 | 1.77 |
| 45 | 1.8 |
| 45 | 1.83 |
| 45 | 1.86 |
| 45 | 1.89 |
| 45 | 1.92 |
| 45 | 1.95 |
| 45 | 1.98 |
| 48 | 1.5 |
| 48 | 1.53 |
| 48 | 1.56 |
| 48 | 1.59 |
| 48 | 1.62 |
| 48 | 1.65 |
| 48 | 1.68 |
| 48 | 1.71 |
| 48 | 1.74 |
| 48 | 1.77 |
| 48 | 1.8 |
| 48 | 1.83 |
| 48 | 1.86 |
| 48 | 1.89 |
| 48 | 1.92 |
| 48 | 1.95 |
| 48 | 1.98 |
| 51 | 1.5 |
| 51 | 1.53 |
| 51 | 1.56 |
| 51 | 1.59 |
| 51 | 1.62 |
| 51 | 1.65 |
| 51 | 1.68 |
| 51 | 1.71 |
| 51 | 1.74 |
| 51 | 1.77 |
| 51 | 1.8 |
| 51 | 1.83 |
| 51 | 1.86 |
| 51 | 1.89 |
| 51 | 1.92 |
| 51 | 1.95 |
| 51 | 1.98 |
| 54 | 1.5 |
| 54 | 1.53 |
| 54 | 1.56 |
| 54 | 1.59 |
| 54 | 1.62 |
| 54 | 1.65 |
| 54 | 1.68 |
| 54 | 1.71 |
| 54 | 1.74 |
| 54 | 1.77 |
| 54 | 1.8 |
| 54 | 1.83 |
| 54 | 1.86 |
| 54 | 1.89 |
| 54 | 1.92 |
| 54 | 1.95 |
| 54 | 1.98 |
| 57 | 1.5 |
| 57 | 1.53 |
| 57 | 1.56 |
| 57 | 1.59 |
| 57 | 1.62 |
| 57 | 1.65 |
| 57 | 1.68 |
| 57 | 1.71 |
| 57 | 1.74 |
| 57 | 1.77 |
| 57 | 1.8 |
| 57 | 1.83 |
| 57 | 1.86 |
| 57 | 1.89 |
| 57 | 1.92 |
| 57 | 1.95 |
| 57 | 1.98 |
| 60 | 1.5 |
| 60 | 1.53 |
| 60 | 1.56 |
| 60 | 1.59 |
| 60 | 1.62 |
| 60 | 1.65 |
| 60 | 1.68 |
| 60 | 1.71 |
| 60 | 1.74 |
| 60 | 1.77 |
| 60 | 1.8 |
| 60 | 1.83 |
| 60 | 1.86 |
| 60 | 1.89 |
| 60 | 1.92 |
| 60 | 1.95 |
| 60 | 1.98 |
| 63 | 1.5 |
| 63 | 1.53 |
| 63 | 1.56 |
| 63 | 1.59 |
| 63 | 1.62 |
| 63 | 1.65 |
| 63 | 1.68 |
| 63 | 1.71 |
| 63 | 1.74 |
| 63 | 1.77 |
| 63 | 1.8 |
| 63 | 1.83 |
| 63 | 1.86 |
| 63 | 1.89 |
| 63 | 1.92 |
| 63 | 1.95 |
| 63 | 1.98 |
| 66 | 1.5 |
| 66 | 1.53 |
| 66 | 1.56 |
| 66 | 1.59 |
| 66 | 1.62 |
| 66 | 1.65 |
| 66 | 1.68 |
| 66 | 1.71 |
| 66 | 1.74 |
| 66 | 1.77 |
| 66 | 1.8 |
| 66 | 1.83 |
| 66 | 1.86 |
| 66 | 1.89 |
| 66 | 1.92 |
| 66 | 1.95 |
| 66 | 1.98 |
| 69 | 1.5 |
| 69 | 1.53 |
| 69 | 1.56 |
| 69 | 1.59 |
| 69 | 1.62 |
| 69 | 1.65 |
| 69 | 1.68 |
| 69 | 1.71 |
| 69 | 1.74 |
| 69 | 1.77 |
| 69 | 1.8 |
| 69 | 1.83 |
| 69 | 1.86 |
| 69 | 1.89 |
| 69 | 1.92 |
| 69 | 1.95 |
| 69 | 1.98 |
| 72 | 1.5 |
| 72 | 1.53 |
| 72 | 1.56 |
| 72 | 1.59 |
| 72 | 1.62 |
| 72 | 1.65 |
| 72 | 1.68 |
| 72 | 1.71 |
| 72 | 1.74 |
| 72 | 1.77 |
| 72 | 1.8 |
| 72 | 1.83 |
| 72 | 1.86 |
| 72 | 1.89 |
| 72 | 1.92 |
| 72 | 1.95 |
| 72 | 1.98 |
| 75 | 1.5 |
| 75 | 1.53 |
| 75 | 1.56 |
| 75 | 1.59 |
| 75 | 1.62 |
| 75 | 1.65 |
| 75 | 1.68 |
| 75 | 1.71 |
| 75 | 1.74 |
| 75 | 1.77 |
| 75 | 1.8 |
| 75 | 1.83 |
| 75 | 1.86 |
| 75 | 1.89 |
| 75 | 1.92 |
| 75 | 1.95 |
| 75 | 1.98 |
| 78 | 1.5 |
| 78 | 1.53 |
| 78 | 1.56 |
| 78 | 1.59 |
| 78 | 1.62 |
| 78 | 1.65 |
| 78 | 1.68 |
| 78 | 1.71 |
| 78 | 1.74 |
| 78 | 1.77 |
| 78 | 1.8 |
| 78 | 1.83 |
| 78 | 1.86 |
| 78 | 1.89 |
| 78 | 1.92 |
| 78 | 1.95 |
| 78 | 1.98 |
| 81 | 1.5 |
| 81 | 1.53 |
| 81 | 1.56 |
| 81 | 1.59 |
| 81 | 1.62 |
| 81 | 1.65 |
| 81 | 1.68 |
| 81 | 1.71 |
| 81 | 1.74 |
| 81 | 1.77 |
| 81 | 1.8 |
| 81 | 1.83 |
| 81 | 1.86 |
| 81 | 1.89 |
| 81 | 1.92 |
| 81 | 1.95 |
| 81 | 1.98 |
| 84 | 1.5 |
| 84 | 1.53 |
| 84 | 1.56 |
| 84 | 1.59 |
| 84 | 1.62 |
| 84 | 1.65 |
| 84 | 1.68 |
| 84 | 1.71 |
| 84 | 1.74 |
| 84 | 1.77 |
| 84 | 1.8 |
| 84 | 1.83 |
| 84 | 1.86 |
| 84 | 1.89 |
| 84 | 1.92 |
| 84 | 1.95 |
| 84 | 1.98 |
| 87 | 1.5 |
| 87 | 1.53 |
| 87 | 1.56 |
| 87 | 1.59 |
| 87 | 1.62 |
| 87 | 1.65 |
| 87 | 1.68 |
| 87 | 1.71 |
| 87 | 1.74 |
| 87 | 1.77 |
| 87 | 1.8 |
| 87 | 1.83 |
| 87 | 1.86 |
| 87 | 1.89 |
| 87 | 1.92 |
| 87 | 1.95 |
| 87 | 1.98 |
| 90 | 1.5 |
| 90 | 1.53 |
| 90 | 1.56 |
| 90 | 1.59 |
| 90 | 1.62 |
| 90 | 1.65 |
| 90 | 1.68 |
| 90 | 1.71 |
| 90 | 1.74 |
| 90 | 1.77 |
| 90 | 1.8 |
| 90 | 1.83 |
| 90 | 1.86 |
| 90 | 1.89 |
| 90 | 1.92 |
| 90 | 1.95 |
| 90 | 1.98 |
| 93 | 1.5 |
| 93 | 1.53 |
| 93 | 1.56 |
| 93 | 1.59 |
| 93 | 1.62 |
| 93 | 1.65 |
| 93 | 1.68 |
| 93 | 1.71 |
| 93 | 1.74 |
| 93 | 1.77 |
| 93 | 1.8 |
| 93 | 1.83 |
| 93 | 1.86 |
| 93 | 1.89 |
| 93 | 1.92 |
| 93 | 1.95 |
| 93 | 1.98 |
| 96 | 1.5 |
| 96 | 1.53 |
| 96 | 1.56 |
| 96 | 1.59 |
| 96 | 1.62 |
| 96 | 1.65 |
| 96 | 1.68 |
| 96 | 1.71 |
| 96 | 1.74 |
| 96 | 1.77 |
| 96 | 1.8 |
| 96 | 1.83 |
| 96 | 1.86 |
| 96 | 1.89 |
| 96 | 1.92 |
| 96 | 1.95 |
| 96 | 1.98 |
| 99 | 1.5 |
| 99 | 1.53 |
| 99 | 1.56 |
| 99 | 1.59 |
| 99 | 1.62 |
| 99 | 1.65 |
| 99 | 1.68 |
| 99 | 1.71 |
| 99 | 1.74 |
| 99 | 1.77 |
| 99 | 1.8 |
| 99 | 1.83 |
| 99 | 1.86 |
| 99 | 1.89 |
| 99 | 1.92 |
| 99 | 1.95 |
| 99 | 1.98 |
| 102 | 1.5 |
| 102 | 1.53 |
| 102 | 1.56 |
| 102 | 1.59 |
| 102 | 1.62 |
| 102 | 1.65 |
| 102 | 1.68 |
| 102 | 1.71 |
| 102 | 1.74 |
| 102 | 1.77 |
| 102 | 1.8 |
| 102 | 1.83 |
| 102 | 1.86 |
| 102 | 1.89 |
| 102 | 1.92 |
| 102 | 1.95 |
| 102 | 1.98 |
| 105 | 1.5 |
| 105 | 1.53 |
| 105 | 1.56 |
| 105 | 1.59 |
| 105 | 1.62 |
| 105 | 1.65 |
| 105 | 1.68 |
| 105 | 1.71 |
| 105 | 1.74 |
| 105 | 1.77 |
| 105 | 1.8 |
| 105 | 1.83 |
| 105 | 1.86 |
| 105 | 1.89 |
| 105 | 1.92 |
| 105 | 1.95 |
| 105 | 1.98 |
+------+-------+
357 rows in set (0.00 sec)
La solución que he pensado es:
"insert into resultados values( select peso,talla from pesos inner join tallas) ";
en el color rojo no se si este bien esto |