SQL - script - temas sueltos
From Ibbddunq
(Difference between revisions)
Line 11: | Line 11: | ||
from formaParte | from formaParte | ||
group by month(diaFn), year(diaFn); | group by month(diaFn), year(diaFn); | ||
- | |||
- | |||
- | |||
- | |||
== Stored procedures == | == Stored procedures == | ||
+ | |||
+ | |||
+ | == Vistas == | ||
+ | |||
== ¿Más elaborados? == | == ¿Más elaborados? == | ||
+ | ROWNUM para MySQL | ||
+ | select @rownum:=@rownum+1 rownum, ... | ||
+ | from (select @rownum=0), ... | ||
+ | |||
INSERT INTO ... SELECT ... | INSERT INTO ... SELECT ... |
Revision as of 01:23, 28 April 2009
Contents |
Cositas chiquitas
LIKE
IN conjunto finito / NOT IN conjunto finito
Cositas no tan chiquitas
Capacidad de agrupar según el resultado de una función. P.ej.
-- cantidad de funciones por mes select month(diaFn) as mes, year(diaFn) as anio, count(*) from formaParte group by month(diaFn), year(diaFn);
Stored procedures
Vistas
¿Más elaborados?
ROWNUM para MySQL
select @rownum:=@rownum+1 rownum, ... from (select @rownum=0), ...
INSERT INTO ... SELECT ...