This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
podoc:count_photos_by_folder_sql_function [2007/04/12 16:14] Luud |
podoc:count_photos_by_folder_sql_function [2007/10/19 20:27] (current) Luud |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Database | + | ===== Database |
=== Name === | === Name === | ||
Line 6: | Line 6: | ||
=== Description === | === Description === | ||
+ | |||
+ | Count the photos in a particular folder. | ||
=== Purpose === | === Purpose === | ||
+ | |||
+ | To retrieve the number of photos in a particular folder. | ||
=== Schema === | === Schema === | ||
- | create function count_photos_by_folder(integer) returns bigint | + | < |
- | as ' | + | create function count_photos_by_folder(integer, |
- | + | select count(identifier) from photo where folder = $1 and can_access_photo(identifier, | |
- | create function count_photos_by_folder(integer, | + | ' language ' |
- | | + | </ |
=== Related tables === | === Related tables === | ||
- | === Related indexes === | + | * [[photo sql table|photo]] |
- | + | ||
- | === Related functions === | + | |
- | + | ||
- | === Related views === | + | |
=== History === | === History === | ||
Line 39: | Line 39: | ||
= Version 2.5 = | = Version 2.5 = | ||
- | | + | <code sql> |
- | as ' | + | create function count_photos_by_folder(integer) returns bigint |
+ | as ' | ||
+ | </ | ||
+ | |||
+ | <code sql> | ||
+ | create function count_photos_by_folder(integer, | ||
+ | as ' | ||
+ | </ | ||
+ | |||
+ | = Version 2.34 = | ||
+ | |||
+ | <code sql> | ||
+ | drop function count_photos_by_folder(integer); | ||
+ | drop function count_photos_by_folder(integer, | ||
- | | + | create |
- | | + | select count(identifier) from photo where folder = $1 and can_access_photo(identifier, |
+ | ' language ' | ||
+ | </ | ||