Skip to content

Tag: sql

Getting the personal contact details of an employee

I want to get the Email, Phone and Mobile number of each employee. The ContactDetailsType contains the Label which is email,phone,fax… and ContactDetails contains the ContactDetailsTypeId (the ID of ContactDetailsType) and the Info having the value of the phone number (for example). I tried the followin…

SQL Sums with Where Clauses

I have a Table of “hours” that I am trying to create a SQL query to total some sums depending on a couple variables. In my table there are HOURS, Location, User, Activity. (with many other fields) I want to Total the sums of Sum(Hours) AS TotalHours, Sum(Hours where Location=Place1) AS OffisteHour…

Problem with deleting items from pivot table

I am building project for learning purposes in oop php where I create properties/ads, and I have three tables, properties, photos and property_photo. My goal is when I click on delete button to delete …