like query for searching a multiple word in table column in sql [closed] - sql

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have table named 'categories' and it has one column name 'catvalues' with values see example below:
catvalues
------------------------
Party wear,Plain,Classic
Party wear,Plain
Party wear,Classic
now i want like query which when i search for 'Party wear,Classic' it should return 2 rows like below:
catvalues
---------------------------
Party wear,Plain,Classic
Party wear,Classic

maybe something like...
SELECT * FROM table
WHERE catvalues LIKE '%Party wear%Classic%'
but i really need more info about your questions
This sounds like your trying to put to much information into one column.

Related

Is there a faster way to add new column data with hundreds of rows? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 11 months ago.
Improve this question
I have a decent-sized table 'countries' with about 10 columns. I recently added a new column to the table 'GDP' and I am entering the information per row using
UPDATE countries
SET GDP=(value)
WHERE name = (country);
I have 200 countries in this table. Is there a better way to update this information?
This project is from Khan Academy. We are asked to select a database and run queries on it. The data was pulled from https://gist.github.com/pamelafox/ad4f6abbaac0a48aa781
I am just making sure that there isn't a more efficient way of adding this information to the existing table 'countries' where the primary key is the name of the country.

SQL how to find number of unique id's [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
enter image description here
enter image description here
Hi, I was wondering how I will find the number of unique (different) customers found in the list above. I have shown the code I have written up but not sure how to get unique Customer ID count as you can see there are many duplicate customerID's because each customer can match with many products.
You can use count(distinct):
select count(distinct customer_id)
from t;

access multiple my sql database at a time? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
how can i access multiple my sql database at time, what is the mechanism behind it?????
eg: i have three different database that contain product(shoes) along with price and there description etc...
so whenever the user type shoes and set its price ... my search bar should be able to retrieve the data in respect of price.. from multiple database..
You can use like
Select * FROM database1.products WHERE field = ?
UNION ALL
SELECT * FROM database2.products field = ?
UNION ALL
SELECT * FROM database3.products field = ?

In Oracle SQL, how do I find where a column may be referenced using just queries? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I have a specific column, called DELIVER_TO_LOCATION_ID , which is in a table called apps.po_requisition_lines_all
I need to dig into the database and derive the continent from the DELIVER_TO_LOCATION_ID ,
In SQL Developer I can't seem to find a way to do this .
any tips appreciated. thanks
You can use following command-
desc tableName
It'll give you description of table including every column in it having any constraints on it or not like primary key, reference key etc.

SQL Server 2008 Replace substring [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have a Screen table which has name and display_name columns. I am trying to replace the word Lawfirm with Law Firm in name and display_name columns for all the records of Screen table.
My SQL experience is pretty premature, I am wondering is there a way to achieve this using a SQL script?
Yes, you can do this:
update screen
set display_name = replace(display_name, 'Lawfirm', 'Law Firm')
where display_name like '%Lawfirm%';