User Tools

Site Tools


podoc:view_random_photo_sql_view

Database View Description of "view_random_photo"

Name

view_random_photo

Description

Purpose

Schema

CREATE VIEW view_random_photo AS
  SELECT photo_version.small_image_path, photo_version.medium_image_path, photo_version.large_image_path
    FROM photo, photo_version
   WHERE photo.identifier=photo_version.photo
     AND photo.identifier=(SELECT CAST(random()*count_photos() AS INTEGER));

History

Used first

Version 2.5

Used last

Still in use

Change history

= Version 2.5 =

CREATE VIEW view_random_photo AS
  SELECT small_image_path, medium_image_path, large_image_path
    FROM photo
   WHERE photo.identifier=(SELECT CAST(random()*count_photos() AS INTEGER));

= Version 2.7 =

DROP VIEW view_random_photo;
 
CREATE VIEW view_random_photo AS
  SELECT photo_version.small_image_path, photo_version.medium_image_path, photo_version.large_image_path
    FROM photo, photo_version
   WHERE photo.identifier=photo_version.photo
     AND photo.identifier=(SELECT CAST(random()*count_photos() AS INTEGER));
podoc/view_random_photo_sql_view.txt · Last modified: 2007/04/23 10:19 by Luud