Skip to content
Advertisement

make multi-condition for query in querysolution this query in mysql [closed]

SELECT * FROM tablename WHERE 
(Border <= 10 AND Border2 >= 100) OR (Border <= 200 AND Border2 >= 500)

But, i’d like to take values of left and right border from query I try to explain make multi-condition for query in query

SELECT TOP 1 Border, Border2 FROM table2 WHERE id in (1,2,3,4,5)

Advertisement

Answer

If you want those values, then don’t select all columns with *, instead select only the columns you want:

SELECT leftBorder, rightBorder FROM...
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement