Subversion Repositories eFlore/Applications.del

Rev

Rev 712 | Rev 733 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
714 jpm 1
-- TODO : Voir comment remplacer le test REGEXP par quelque chose de plus simple.
712 jpm 2
 
714 jpm 3
CREATE VIEW del_utilisateur AS
4
	SELECT id_utilisateur, prenom, nom, courriel, mot_de_passe, licence_acceptee
5
	FROM tb_cel.cel_utilisateurs;
712 jpm 6
 
7
CREATE VIEW del_observation AS
714 jpm 8
	SELECT id_observation, ce_utilisateur, nom_sel, nom_sel_nn, nom_ret, nom_ret_nn, nt, famille,
9
		ce_zone_geo, zone_geo, lieudit, station, milieu,
10
		date_observation, mots_cles_texte, commentaire,
11
		date_creation, date_modification, date_transmission
12
	FROM tb_cel.cel_obs
13
	WHERE transmission = '1'
14
		AND ce_utilisateur REGEXP '^[[:digit:]]+$';
712 jpm 15
 
714 jpm 16
CREATE VIEW del_obs_images AS
17
	SELECT oi.id_image, oi.id_utilisateur, oi.id_observation, oi.date_liaison
18
	FROM tb_cel.cel_obs_images AS oi
19
		INNER JOIN tb_cel.cel_obs AS o ON (oi.id_observation = o.id_observation)
20
	WHERE o.transmission = '1'
21
		AND oi.id_utilisateur REGEXP '^[[:digit:]]+$';
22
 
23
CREATE VIEW del_image AS
24
	SELECT i.id_image, i.ce_utilisateur, i.hauteur, i.largeur, i.date_prise_de_vue, i.mots_cles_texte,
25
		i.commentaire, i.nom_original, i.date_modification, i.date_creation, i.publiable_eflore
26
	FROM tb_cel.cel_images AS i ON (i.id_image = oi.id_image)
27
		INNER JOIN tb_cel.cel_obs_images AS oi ON (oi.id_observation = o.id_observation)
28
		INNER JOIN tb_cel.cel_obs AS o
29
	WHERE o.transmission = '1'
30
		AND i.id_utilisateur REGEXP '^[[:digit:]]+$';