How to compare data in SQL [closed] - sql

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have an application which is taking data from questionnaires users are completing on a website and inputting this into a SQL Lite database.
I'm using Django and would like to display data of users who match closest by selecting similar answers.
How could this be done?

You can add multiple join conditions like this
SELECT *
FROM <table>
INNER JOIN <same table different name>
ON (condition1 OR condition2 OR condition3)

Related

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

SQL Server - Select [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Please, how do I SELECT, to get the result column?
columns
SELECT machine, software
FROM ms_tbl
INNER JOIN machine_tbl
ON machine_tbl.machine_id = ms_tbl.machine_id
INNER JOIN software_tbl
ON software_tbl.software_id = ms_tbl.software_id;

Oracle Query not Working [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 6 years ago.
Improve this question
oracle query is not working. Please specify what is wrong in this query?
(select hacker_id,challenge_id, max(score) as soc
from submissions
group by hacker_id,challenge_id
having max(score)>0) t2;
Please read #OldProgrammer comments. Anyway, I think this should work for you
select hacker_id,challenge_id, max(score) as soc
from submissions
group by hacker_id,challenge_id
having max(score)>0;

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%';

Optimization of for loop in oracle [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 9 years ago.
Improve this question
I was asked on my apprenticeship following question:
Why query like:
FOR i in ( SELECT * FROM TABELKA) LOOP
is not efficient? How to change it to make it more efficient?
There is no further information added.
Collect, all data at once, into a collection. Boom! One query and you have it all without looping.
SELECT *
BULK COLLECT INTO a_collection_type_variable
FROM a_table;