Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. SQL

SQL

Scheduled Pinned Locked Moved Database
databasehelpquestion
6 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shiv irfi
    wrote on last edited by
    #1

    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.

    M L A P 4 Replies Last reply
    0
    • S Shiv irfi

      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.

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      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

      K 1 Reply Last reply
      0
      • M Mycroft Holmes

        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

        K Offline
        K Offline
        Killzone DeathMan
        wrote on last edited by
        #3

        We are some kind of "gods" and we can read minds :laugh:

        1 Reply Last reply
        0
        • S Shiv irfi

          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.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          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=1

          Shiv 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=1

          Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

          1 Reply Last reply
          0
          • S Shiv irfi

            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.

            A Offline
            A Offline
            Azarudhin
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            • S Shiv irfi

              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.

              P Offline
              P Offline
              prakash chakrala
              wrote on last edited by
              #6

              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',1003

              then 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

              Prakash.ch

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups