Postgres column doesn't exist error on update [closed] - sql

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 3 years ago.
Improve this question
I am trying to run the query below but I am getting an error ERROR: column "test.pdf" does not exist . I dont know why I am getting this error. I search for various links on stackover but none solved my problem like this PostgreSQL query -- column does not exist, Postgres error updating column data. Please help me find the problem.
bill is a type string field in bills table.
update bills
set bill = "test.pdf"
where id=3;

Change the double quotes you have around test.pdf to single quotes.

Related

Presto: parse an entire column from a string to a date [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 days ago.
Improve this question
Current code I have is as follows:
select date_parse(column_name,'%Y-%m-%d %H:%i:%s')
This is the error I receive:
Error running query: line 1:19: Column "column_name" cannot be
resolved
I know that the format of the date I inserted is correct because I tested it with a value I have in the database and it returned the correct date value. It may be related to several records having no value in the column specified? Not exactly sure how I would account for that
I'm expecting the code to turn the entire column from a string into a date

Dash in SQL Record [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 11 months ago.
Improve this question
I am trying to insert records into my table but keep getting an error due to the dash (Invalid column name 'NJB572'), how can I go about this? I have 2 columns in this table, both VARCHAR.
INSERT INTO dbo.Inventory VALUES
(131-NJB572, 'BROOM')
(PTI-I20, '9/16 IRONWORKERS')
(PTI-I16, '13/16" PUNCH');
You can use quotes to wrap the column names.
Try,
INSERT INTO dbo.Inventory VALUES
('131-NJB572', 'BROOM')
,('PTI-I20', '9/16 IRONWORKERS')
,('PTI-I16', '13/16" PUNCH');

I'd like to insert any value using 'insert into' but it doesn't work. What is "Column not found error"? [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
I created table "member". It has two columns name, id and no values. And I'm trying to insert value "spring" into column name!
But It doesn't work...Can anybody help me please?
I wrote like this:
insert into member(name) values("spring");
error is:
Column "spring" not found; SQL statement:
insert into member(name)
values("spring") [42122-200] 42S22/42122
You should use single quotes for your String/Varchar values.
Try this query:
insert into member(name) values('spring');

SQL Update sot issue [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
I am trying to update the cost of an item in our database:
UPDATE dbo.PartMaster
SET Cost = ‭0.0017178141193889‬
WHERE PartNumber = '93275K12'
I am getting an error
Msg 102, Level 15, State 1, Line 2
Incorrect syntax near '‭'.
The Cost is of float type. I have updated costs before without issue. But cannot find what the syntax issue is. Please help
copy/paste into something like NotePad++ and make sure all hidden characters are visible. I've seen this a lot when copying/pasting values from emails, there are hidden characters that SSMS can't show.
or if that doesn't show anything, open in a new tab and re-type it all without copy/pasting. (only 3 lines so not a big job)

SQL COUNT() statement not working [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 years ago.
Improve this question
I am trying to return the total number of reserved seats in my flightbooking table using a flightID number.
SELECT COUNT(flight.flightid) AS reservedseats FROM flightbooking
WHERE status=R
I get an error saying
ERROR: missing FROM-clause entry for table "flight"
LINE 1: SELECT COUNT(flight.flightid) AS reservedseats FROM flightbo...
What am i doing wrong?
Try:
SELECT COUNT(flight.flightid) AS reservedseats
FROM flightbooking AS flight
WHERE status='R'
You were referring to flight.flightid but there isn't a table with name or alias flight. The engine doesn't know where it should retrieve flightid from.
You were also missing quotes around the char value R.
In your comment you say "I know nothing about SQL". It is much appriciated if you do some research yourself before you come here asking for help.