Skip to main content
Formatting
Source Link
Paul White
  • 90.3k
  • 30
  • 424
  • 663

I am trying to find a way to query a tables in my database. The table is called districts which contains a boroidboroid and areaarea column. Basically the community table looks like:

boroid |  area   
--------+---------------
101 | 41641860.1953
104 | 49300667.7004
106 | 38700249.8776
112 | 77981905.0100
210 | 174703337.756
301 | 132531300.780
306 | 131678770.100
303 | 246427540.049
302 | 167440618.596
402 | 171605041.803 

boroid  |  area   
--------+---------------
101     | 41641860.1953
104     | 49300667.7004
106     | 38700249.8776
112     | 77981905.0100
210     | 174703337.756
301     | 132531300.780
306     | 131678770.100
303     | 246427540.049
302     | 167440618.596
402     | 171605041.803 

I am trying to find all community districts within the ranges 101-108, 301-303 and only 402. Can someone help me achieve this? Below is my query:

   SELECT boroid from districts where ('[101-108]','[301-303]','[402]'); 

I am trying to find a way to query a tables in my database. The table is called districts which contains a boroid and area column. Basically the community table looks like:

boroid |  area   
--------+---------------
101 | 41641860.1953
104 | 49300667.7004
106 | 38700249.8776
112 | 77981905.0100
210 | 174703337.756
301 | 132531300.780
306 | 131678770.100
303 | 246427540.049
302 | 167440618.596
402 | 171605041.803 

I am trying to find all community districts within the ranges 101-108, 301-303 and only 402. Can someone help me achieve this? Below is my query:

   SELECT boroid from districts where ('[101-108]','[301-303]','[402]'); 

I am trying to find a way to query a tables in my database. The table is called districts which contains a boroid and area column. Basically the community table looks like:


boroid  |  area   
--------+---------------
101     | 41641860.1953
104     | 49300667.7004
106     | 38700249.8776
112     | 77981905.0100
210     | 174703337.756
301     | 132531300.780
306     | 131678770.100
303     | 246427540.049
302     | 167440618.596
402     | 171605041.803 

I am trying to find all community districts within the ranges 101-108, 301-303 and only 402. Can someone help me achieve this? Below is my query:

SELECT boroid from districts where ('[101-108]','[301-303]','[402]'); 

How do i select a range Select multiple ranges in wherea WHERE clause?

Source Link

How do i select a range in where clause?

I am trying to find a way to query a tables in my database. The table is called districts which contains a boroid and area column. Basically the community table looks like:

boroid |  area   
--------+---------------
101 | 41641860.1953
104 | 49300667.7004
106 | 38700249.8776
112 | 77981905.0100
210 | 174703337.756
301 | 132531300.780
306 | 131678770.100
303 | 246427540.049
302 | 167440618.596
402 | 171605041.803 

I am trying to find all community districts within the ranges 101-108, 301-303 and only 402. Can someone help me achieve this? Below is my query:

   SELECT boroid from districts where ('[101-108]','[301-303]','[402]');