looking for some solutions? You are welcome.

SOLVED: Querying Data in Postgre SQL

Jonathan Carr:

I'm not sure what is going on or what I'm doing wrong. New to Postgre, I've added three tables into the program however I'm having trouble querying all three. When I run the first database Departments, I have no problem generating results.

-- INPUT
SELECT * from public."Departments";

-- OUTPUT
"Customer Service"      1
"Receivable Management" 2
"HR"    3
-- INPUT
SELECT id from public."Departments"

-- OUTPUT
1
2
3

However, when I try and use the same code for any other table, it works for selecting all the rows:

-- INPUT
SELECT * FROM public."Manager_data"

--OUTPUT
ID  First_name  Last_name Department  Hire_date
1       "Jamie" "Holland"       "Customer Service"      "2013-01-05"
2       "Samuel"        "Stuart"        "Recievable Management" "2014-04-15"
3       "Lana"  "Lang"  "Customer Service"      "2014-06-06"
4       "Kristen"       "Callen"        "Recievable Management" "2015-05-27"
5       "Mary"  "Louise"        "Customer Service"      "2015-07-07"

But gives me an error when I try and select one row:

--INPUT 
SELECT Hire_date from public."Manager_data"

--OUTPUT

ERROR:  column "hire_date" does not exist
LINE 1: SELECT Hire_date from public."Manager_data"
               ^
HINT:  Perhaps you meant to reference the column "Manager_data.Hire_date".
SQL state: 42703
Character: 8

No idea what I'm doing wrong. I've tried it with the suggested hint but that didn't work either. Please help!



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
Share:

No comments:

Recent