I am going to define a table for Book's Publisher so I want to give a name like Book_Publisher_Mapping. But when I will map this with EF then It creates a partial class that name is Book_Publisher_Mapping. So it is not good name for class. I think class name should be like BookPublisherMapping. So I should define table like BookPublisherMapping. It's a good naming convention for table name in Pascal case without _.
This query shows emplName,emplID, totalworking time, InTime, OutTime, DateVisited, Overtime for an employee based on his InTime and Outime, that's OK. Now i am trying to modify it to show only emplID, EmplName, Total Working hours(Per month), total overtime (per month).
i have written this query to show total working time and overtime of an employee on particular date (if he has came) otherwise it doesn't show record for a person if his INTIME and TIMEOUT are empty but i don't want this now, i want if for a particular date person's INtime and OutTime are empty then put 00:00 in his intime, outtime, totalworkingtime, overtime.
When building these type of query I break it down to getting the primary list (employees) and getting the data you are reporting (timesheet information) then I use a left outer join between the primary and data queries and use ISNULL to display the default values (00:00).
Never underestimate the power of human stupidity
I have two tables 1- Holds the cars passed (CarId, DeviceId, PassDate)
2- Holds the List of Cameras capturing each car (DeviceID, DeviceName)
I want to check on a specific Date the maximum number of car passed in period(every 60 minutes, 2 hours …)
So I have to use a double loop the first for each device and the second for the period.
For(every period in the time)
The should look like this List
Device Name --------- Max Passed Cars
Since I’m new to oracle SQL Programming I dunno how to implement this, I appreciate it if you can help me out
WITH CTE AS (
,TO_CHAR(PassDate, 'YYYY-MM-DD HH24') AS hours
,TRUNC(PassDate, 'HH24') AS hours
FROM cars c,devices d
WHERE c.DeviceID = d.DeviceID
SELECT Count(carID) Cars_passed
<edit>Revisited and fixed so that hours remains the correct type</edit>