Queries

De wiki
Saltar a: navegación, buscar

Todas las notas

SELECT
    Thingy.createdOn AS noteCreatedOn,
    Thingy.createdBy AS noteCreatedBy,
    Note.description AS noteDescription,
    COALESCE(Contact.name, TRIM(CONCAT(Contact.firstName,' ',Contact.lastName))) AS noteReferenceContact  
FROM 
    Note JOIN Thingy ON Note.id = Thingy.id
         JOIN ThingyRelation ON Note.id = ThingyRelation.fromId AND ThingyRelation.code = '@' 
         JOIN Contact ON ThingyRelation.toId = Contact.id
campo descripción
taskCreatedOn fecha en que se creó la tarea
taskCreatedBy usuario que creó la tarea
taskDue fecha espera de culminación de la tarea
taskCompleted fecha en que realmente se completó la tarea
taskSupervised fecha en que realmente se supervisó la tarea
noteDescription descripción de la tarea
noteReferenceContact nombre del contacto relacionado con esta tarea

Todas las tareas

SELECT
    Thingy.createdOn AS taskCreatedOn,
    Thingy.createdBy AS taskCreatedBy,
    Task.due AS taskDue,
    Task.completed AS taskCompleted,
    Task.supervised AS taskSupervised,
    Task.description AS noteDescription,
    COALESCE(Contact.name, TRIM(CONCAT(Contact.firstName,' ',Contact.lastName))) AS noteReferenceContact
FROM 
    Task JOIN Thingy ON Task.id = Thingy.id
         JOIN ThingyRelation ON Task.id = ThingyRelation.fromId AND ThingyRelation.code = '@' 
         JOIN Contact ON ThingyRelation.toId = Contact.id