I am trying to write an SQL query that will search in a CSV (or similar) array in a column. Here is an example:
paste into the set of properties Bedrooms = 1,2,3 (or 1-3) title = nice property price = 500
I would then search for where bedrooms = 2+. Is it possible?
This is usually not how you should store data in a relational database.
Perhaps you should have a column MinBedroomand MaxBedroom. For example:
MinBedroom
MaxBedroom
SELECT * FROM properties WHERE MinBedroom > 1 AND MaxBedroom < 3;
SQL - . . "-", SQL.
, , , , , . , , , .
SELECT * FROM properties WHERE bedrooms RLIKE '[[:<:]]2[[:>:]]';
, , , . , , , , . :
, .
, , , .
Source: https://habr.com/ru/post/1722157/More articles:Database design: storing delimited strings in a database is bad - database-designПолучение сертификата Symbian Code Signing в качестве единого разработчика? - code-signingKML / Google Map - indicating the zoom level of the embedded map in iFrame - google-mapsWhy is the size of any type of data dependent on the machine? - programming-languages | fooobar.comporting an application from dotnet 2.0 to 3.5 - c #Spring - Aspect does not apply at run time - springpdo binding asc / desc order dynamically - databaseCSS hover menu appears behind pdf iframe - cssCompile the .pyw file so that it can be run as .pyc without the console - pythonWPF - How to report what caused the ComboBox_SelectionChanged event - c #All Articles