Consultas
Enviado por LuisLaura • 20 de Septiembre de 2015 • Informe • 1.509 Palabras (7 Páginas) • 142 Visitas
SELECT glpi_reservations.begin, glpi_reservations.end, glpi_computers.name, glpi_users.realname, glpi_users.firstname, glpi_reservations.comment
FROM glpi_reservations, glpi_computers, glpi_users;
new
SELECT * FROM glpi_reservations ;
SELECT * FROM glpi_computers_devicedrives g;
SELECT * FROM ocsweb.glpi_reservationitems g;
SELECT * FROM ocsweb.glpi_reservationitems g;
SELECT * FROM ocsweb.glpi_users g;
SELECT * FROM glpi_computers ;
SELECT begin, end, users_id, comment FROM glpi_reservations ORDER BY begin ASC;
SELECT begin, end, glpi_reservations.comment, glpi_users.name NOMBRE_USUARIO, glpi_computers.name NOMBRE_MATERIAL
FROM glpi_reservations
inner join glpi_users
on glpi_reservations.users_id = glpi_users.id
inner join glpi_computers
on glpi_reservations.reservationitems_id = glpi_computers.id
ORDER BY begin ASC;
////////
SELECT glpi_reservations.begin, glpi_reservations.end, glpi_reservations.comment, glpi_computers.name
FROM glpi_reservations
INNER JOIN glpi_reservationitems
ON glpi_reservations.reservationitems_id = glpi_reservationitems.items_id
INNER JOIN glpi_computers
ON glpi_reservationitems.items_id = glpi_computers.id;
////////
La buena
SELECT glpi_reservations.begin, glpi_reservations.end, glpi_reservations.comment, glpi_reservationitems.id, glpi_reservationitems.items_id, glpi_computers.name
FROM glpi_reservations
INNER JOIN glpi_reservationitems
ON glpi_reservationitems.id = glpi_reservations.reservationitems_id
LEFT JOIN glpi_computers
ON glpi_computers.id = glpi_reservationitems.items_id;
---------------la buena con nombres--------------------
SELECT glpi_reservations.begin, glpi_reservations.end, glpi_reservations.comment, glpi_reservationitems.id,
glpi_reservationitems.items_id, glpi_computers.name, glpi_users.name NOMBRE_USUARIO
FROM glpi_reservations
INNER JOIN glpi_reservationitems
ON glpi_reservationitems.id = glpi_reservations.reservationitems_id
INNER JOIN glpi_users
ON glpi_reservations.users_id = glpi_users.id
LEFT JOIN glpi_computers
ON glpi_computers.id = glpi_reservationitems.items_id;
///////para php//////
SELECT glpi_reservations.begin, glpi_reservations.end, glpi_computers.name NOMBRE_MATERIAL, glpi_users.name NOMBRE_USUARIO, glpi_reservations.comment
FROM glpi_reservations
INNER JOIN glpi_reservationitems
ON glpi_reservationitems.id = glpi_reservations.reservationitems_id
INNER JOIN glpi_users
ON glpi_reservations.users_id = glpi_users.id
LEFT JOIN glpi_computers
ON glpi_computers.id = glpi_reservationitems.items_id;
//////////////////////////
SELECT glpi_reservations.begin, glpi_reservations.end, glpi_computers.name NOMBRE_MATERIAL,
CONCAT (glpi_users.firstname, ' ', glpi_users.realname)AS NOMBRE_C, glpi_reservations.comment
FROM glpi_reservations
INNER JOIN glpi_reservationitems
ON glpi_reservationitems.id = glpi_reservations.reservationitems_id
INNER JOIN glpi_users
ON glpi_reservations.users_id = glpi_users.id
LEFT JOIN glpi_computers
ON glpi_computers.id = glpi_reservationitems.items_id
/////////////////// tablas a ocupar en reporte por usuario
sELECT * FROM glpi_computers g;
SELECT * FROM glpi_users g;
SELECT * FROM glpi_monitors g;
SELECT * FROM glpi_states g;
SELECT * FROM glpi_computers_items g;
SELECT * FROM glpi_displaypreferences g;
SELECT * FROM glpi_events g;
SELECT * FROM glpi_groups g;
SELECT * FROM glpi_logs g;
SELECT * FROM glpi_networkports g;
SELECT * FROM glpi_operatingsystems g;
SELECT * FROM glpi_peripherals g;
SELECT * FROM glpi_peripheraltypes g;
SELECT * FROM glpi_printers g;
SELECT * FROM glpi_printertypes g;
SELECT * FROM glpi_reservationitems g;
SELECT * FROM glpi_monitormodels g;
SELECT * FROM glpi_computermodels g;
SELECT * FROM glpi_manufacturers g;
SELECT * FROM glpi_groups_users g;
SELECT * FROM glpi_profiles g;
SELECT * FROM glpi_profiles_users g;
select glpi_computers.name, glpi_users.name from glpi_computers,glpi_users;
SELECT * FROM glpi_knowbaseitems_users g;
select * from glpi_computers_items
inner join glpi_users
on glpi_computers.id = glpi_users.id
inner join glpi_monitors
on glpi_computers.id = glpi_computers.id;
select glpi_computers.name,glpi_monitors.name, glpi_users.name,glpi_monitors.serial,glpi_computers.serial from glpi_monitors
inner join glpi_users
on glpi_monitors.users_id = glpi_users.id
inner join glpi_computers
on glpi_computers.users_id = glpi_users.id;
where glpi_monitors.id=3;
select glpi_computers.name,glpi_monitors.name, glpi_users.name,glpi_monitors.serial,glpi_computers.serial from glpi_users
inner join glpi_monitors
on glpi_monitors.users_id = glpi_users.id
inner join glpi_computers
on glpi_computers.users_id = glpi_users.id;
where glpi_users.id=6;
///////
la mera mera!! para segundo reporte
select glpi_networkports.itemtype TIPO_DE_ELEMENTO,glpi_computers.name NOMBRE,glpi_manufacturers.name FABRICANTE,
glpi_computers.serial,glpi_states.name ESTADO, glpi_users.firstname USAUARIO
from glpi_users
inner join glpi_monitors
on glpi_monitors.users_id = glpi_users.id
inner join glpi_computers
on glpi_computers.users_id = glpi_users.id
inner join glpi_manufacturers
...