Skip to main content

All Questions

Tagged with
-1 votes
1 answer
130 views

Find Employees having Pending Salary

There is a table - 'EmpSalary' - with Employee ID, Salary paid date and Salary amount. When a salary is paid for an employee, an entry will be posted in this table. I want to find out the employees ...
Vijay's user avatar
  • 1
0 votes
3 answers
2k views

Convert Legacy SQL Outer JOIN *=, =* to ANSI

I need to convert a legacy SQL outer Join to ANSI. The reason for that being, we're upgrading from a legacy DB instance (2000/5 ?) to SQL 2016. Legacy SQL query :- SELECT --My Data to Select-- FROM ...
Uday Mehta's user avatar
0 votes
2 answers
234 views

How to join tables when there are duplicates in right table

I have three tables. Table Cust has a custID field, plus various other values (name, address etc) Table List has a single column ID. Each ID is a custID in the Cust table Edit: the purpose of this is ...
David Siegel's user avatar
0 votes
4 answers
1k views

Join multiple tables with same structure but different data

I'm trying to make a join between 8 tables and because each of table has more than 500,000 entries, it is very slow. I want to know that, do you have any best way to join these tables? All tables has ...
Aria R.'s user avatar
  • 13
2 votes
3 answers
81 views

Join 2 tables with where and MAX

I have 2 tables; TableSN snID SerialNR Unit Version 1 123 A A1 2 456 A A2 TableDelivery dID SerialNR Team 1 456 US 2 456 GE 3 456 FI Result ...
makelei's user avatar
  • 23
0 votes
1 answer
60 views

Join not working properly

I am inserting value into the table like below INSERT INTO p_leave_allocation_11122015(Mkey, Entry_Sr_no, Comp_mkey,FDepartment_Id,FModule_Id,Year, Emp_mkey, Emp_card_no, U_Datetime, Delete_Flag,...
hud's user avatar
  • 4,701
1 vote
1 answer
185 views

How To Select Manager Name From This Stored Procedure?

I am trying to get an employee manager's first and last name IF the employee has a manager ( Some employee's do not ex CEO etc ). Currently it returns the employee name for manager and if there is no ...
ImDeveloping's user avatar
0 votes
1 answer
56 views

How to have multiple where clauses in SQL query

In the following query I am trying to get specifically a managers name using the 'not so looked up to' subquery. I am only using this subquery as I do not know how to specify another where clause for ...
user avatar
0 votes
1 answer
51 views

Why does query performance diminish with additional join conditions

I have a simple query with two tables. massfehler_hardware has 50K rows and no indexes. f_produkt has 38M rows with a clustered unique index on account_number, item_number, contract_number, [and some ...
ercan's user avatar
  • 1,708
-1 votes
2 answers
795 views

self join-SQL -Query

In an interview the below questions asked and couldn't provide an appropriate answer. Question 1: if i have a table with employee id and manager i want to display it in the below format with employee ...
Tom Cruise's user avatar
  • 1,405
0 votes
2 answers
61 views

SQL server join query to get all subjects

I have the three tables: TBL_SUBJECT, TBL_SEMESTER and TBL_SUBJECT_SEMESTER_MAPPING I am having subjectId with me say '1', I want to get All the subjects of the semester to which my subject belongs. ...
Syed Qayyum's user avatar
0 votes
1 answer
91 views

SQL join to add missing rows

I am new to SQL and need some help. In a scenario I want to join on Teachers Table where I have Data of subject a teacher taught. I want to add some missing rows through join so that I can show the ...
XYZ's user avatar
  • 119
0 votes
2 answers
70 views

How to join an existing table that has starting date and closing date to the existing calendar table to calculate working days

How to join an existing table that has starting date and closing date to the existing calendar table to calculate working days . My calendar table looks like this :- dt isweekday isholiday Y ...
jamshed osmani's user avatar
0 votes
1 answer
48 views

Multiple joins on same table?

I have two table: tbl_EmploymentSegmentEM: ╔══════╦═════════════╦════════════╦═══════════════╦═══════════════════════════════╦════════════╦═════════════╦══════════════════════════╦════════════════╗ ...
SamuraiJack's user avatar
  • 5,389
0 votes
0 answers
209 views

Using JOIN and SUM in SQL-Server Create View without "DISTINCT"

I'm using SQL Server 2005. I'm trying to make an index view based on a query of these tables joined: Table Name: CallRecords TN Carrier CallDate Calls -----------------------------------...
kelseyelayne's user avatar

15 30 50 per page
1
2 3 4 5
11