SQL
-
Hello everyone, I created a table which has following columns Sl_no,name and employee_id. Is that a possible when i select a table i should get a designation of an employee in place of his name?? Kindly please help me out.
What we are supposed to be telepathic! What database server What is your select query There is no field called designation in your table! Never underestimate the power of human stupidity RAH
-
What we are supposed to be telepathic! What database server What is your select query There is no field called designation in your table! Never underestimate the power of human stupidity RAH
We are some kind of "gods" and we can read minds :laugh:
-
Hello everyone, I created a table which has following columns Sl_no,name and employee_id. Is that a possible when i select a table i should get a designation of an employee in place of his name?? Kindly please help me out.
Shiv irfi wrote:
I created a table which has following columns Sl_no,name and employee_id
SELECT Sl_no, name, employee_id
FROM [a table]
WHERE 1=1Shiv irfi wrote:
Is that a possible when i select a table i should get a designation of an employee in place of his name??
Yes.
SELECT Sl_no, designation, employee_id
FROM [a table]
WHERE 1=1Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
-
Hello everyone, I created a table which has following columns Sl_no,name and employee_id. Is that a possible when i select a table i should get a designation of an employee in place of his name?? Kindly please help me out.
hi, If you had a separate table for the designations for that employees then u can join both the tables and get what ever fields u have and make aliasing names for that columns... Otherwise it is not possible to get because u are not having the designation column in the Your table
-
Hello everyone, I created a table which has following columns Sl_no,name and employee_id. Is that a possible when i select a table i should get a designation of an employee in place of his name?? Kindly please help me out.
Hi First create Employee table
CREATE TABLE EMPLOYEE
(
Sl_no int identity,
Name varchar(40),
Employee_id int)
insert the values
INSERT INTO EMPLOYEE(Name,Employee_id)
SELECT 'Anil',1001
UNION ALL
SELECT 'Mahesh',1002
UNION ALL
SELECT 'Raju',1003then create designation table
CREATE TABLE DESIGNATION
(
Employee_id INT,
Designation varchar(30)
)then insert the values
INSERT INTO DESIGNATION
SELECT 1001, 'Developer'
UNION ALL
SELECT 1002, 'Tester'
UNION ALL
SELECT 1003, 'Trainee'then follow this query
SELECT E.*,D.Designation FROM EMPLOYEE E INNER JOIN DESIGNATION D ON E.Employee_id=D.Employee_id