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 last month.
Improve this question
I want to display all the names in a table that contains the character '+' but it doesn't work on Oracle SQL developer, while the column contains names with '+'
Select *
from Table where NAME like '%+%';
==> I got an empty output
Example:
Could you help me please ?!
You can use this statement:
Select *
from Table where NAME like '%' || chr(43) || '%';
Thank you
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');
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 am getting this error
ERROR: syntax error at or near "("Position: 65```
for the following query
insert into Employee(no,name,phone) values ((1,Kenit,999999999)(2,Kenit,999999999)(3,Kenit,999999999)(4,Kenit,999999999)(5,Kenit,999999999)(6,Kenit,999999999))
Probably you need commas between paranthesis for each record. And "Kenit" should be in quotes
insert into Employee(no,name,phone) values ((1,'Kenit',999999999),
(2,'Kenit',999999999),(3,'Kenit',999999999),(4,'Kenit',999999999),
(5,'Kenit',999999999),(6,'Kenit',999999999))
Try googling.
Source: https://www.sqlservertutorial.net/sql-server-basics/sql-server-insert-multiple-rows/
INSERT INTO table_name (column_list)
VALUES
(value_list_1),
(value_list_2),
...
(value_list_n);
INSERT INTO Employee (no,name,phone) VALUES ((1,Kenit,999999999),(2,Kenit,999999999),(3,Kenit,999999999),(4,Kenit,999999999),(5,Kenit,999999999),(6,Kenit,999999999));
happy to help
also: phone numbers should be saved in strings, as well as your names. so adding quotation marks helps not only in readability of the code it gives required LOGIC:
example:
...('asdf', 123, '+8920841209')
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
select *
from table_name
where charindex(dest_mail,'abc#mail.com') >0
In the above query dest_mail is a column, but there is another entry in the table, which is 'bc#mail.com'. When I try to execute the above query, I'm getting two results
1.abc#mail.com
2.bc#mail.com
How to get exact 'abc#mail.com'?
Have you considered =?
where dest_mail = 'abc#mail.com'
Also, charindex() is not very colloquial SQL for this purpose; = is a built-in standard operator (charindex() is not standard). And a bonus to = is that it allows the optimizer to take advantage of indexes and partitions.
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.