
Download in slices up to 3 mil records:

https://gea.esac.esa.int/archive/
SELECT gaia_source.ra,gaia_source.dec, gaia_source.pmra, gaia_source.pmdec, gaia_source.phot_g_mean_mag, gaia_source.phot_bp_mean_mag, gaia_source.phot_rp_mean_mag
FROM gaiaedr3.gaia_source 
WHERE (gaiaedr3.gaia_source.phot_bp_mean_mag>=15.65 AND gaiaedr3.gaia_source.phot_bp_mean_mag<15.75)

use copy demand to combine files:
copy /A Gaia_DR3_BP_17.4*.csv hGaia_DR3_BP_17.4.csv


Filter out stars without BP up to magnitude 17.75. Note V is 0.3 magnitudes above GP and BP 0.5 magnitude so up to magn 17.75 is enough

SELECT gaia_source.ra,gaia_source.dec,gaia_source.pmra,gaia_source.pmdec,gaia_source.phot_g_mean_mag,gaia_source.phot_bp_mean_mag,gaia_source.phot_rp_mean_mag
FROM gaiaedr3.gaia_source 
WHERE gaiaedr3.gaia_source.phot_g_mean_mag is not NULL  AND gaiaedr3.gaia_source.phot_g_mean_mag>=-5 AND gaiaedr3.gaia_source.phot_g_mean_mag<17.35 AND gaiaedr3.gaia_source.phot_bp_mean_mag is NULL

SELECT gaia_source.ra,gaia_source.dec,gaia_source.pmra,gaia_source.pmdec,gaia_source.phot_g_mean_mag,gaia_source.phot_bp_mean_mag,gaia_source.phot_rp_mean_mag
FROM gaiaedr3.gaia_source 
WHERE gaiaedr3.gaia_source.phot_g_mean_mag is not NULL  AND gaiaedr3.gaia_source.phot_g_mean_mag>=17.35  AND gaiaedr3.gaia_source.phot_g_mean_mag<17.75 AND gaiaedr3.gaia_source.phot_bp_mean_mag is NULL



------------------------------------------------------------------------------------------------------------------------------------------------------------------------
===================================================================================================================

-- output format : csv
SELECT TOP 990000000  "I/350/gaiaedr3".RA_ICRS,  "I/350/gaiaedr3".DE_ICRS,   "I/350/gaiaedr3".pmRA,  "I/350/gaiaedr3".pmDE,   "I/350/gaiaedr3".Gmag, "I/350/gaiaedr3".BPmag,  "I/350/gaiaedr3".RPmag
FROM "I/350/gaiaedr3" 
WHERE "I/350/gaiaedr3".Gmag is not NULL and "I/350/gaiaedr3".Gmag<=18.05 and  "I/350/gaiaedr3".BPmag is NULL

-- output format : csv
SELECT TOP 990000000  "I/350/gaiaedr3".RA_ICRS,  "I/350/gaiaedr3".DE_ICRS,   "I/350/gaiaedr3".pmRA,  "I/350/gaiaedr3".pmDE,   "I/350/gaiaedr3".Gmag, "I/350/gaiaedr3".BPmag,  "I/350/gaiaedr3".RPmag
FROM "I/350/gaiaedr3" 
WHERE "I/350/gaiaedr3".BPmag>=11.55 and "I/350/gaiaedr3".BPmag<11.65

Gaia_DR3_BP_11.6.csv



-- output format : csv
SELECT TOP 990000000  "I/350/gaiaedr3".RA_ICRS,  "I/350/gaiaedr3".DE_ICRS,   "I/350/gaiaedr3".pmRA,  "I/350/gaiaedr3".pmDE,   "I/350/gaiaedr3".Gmag, "I/350/gaiaedr3".BPmag,  "I/350/gaiaedr3".RPmag
FROM "I/350/gaiaedr3" 
WHERE "I/350/gaiaedr3".Gmag>=-9.55 and "I/350/gaiaedr3".Gmag<9.00
Gaia_DR3_G_upto_09.0.csv



 -- output format : csv
 SELECT "I/350/gaiaedr3".RA_ICRS,  "I/350/gaiaedr3".e_RA_ICRS,  "I/350/gaiaedr3".DE_ICRS,  "I/350/gaiaedr3".e_DE_ICRS,  "I/350/gaiaedr3".Source,  "I/350/gaiaedr3".Plx,  "I/350/gaiaedr3".e_Plx, 
 "I/350/gaiaedr3".PM,  "I/350/gaiaedr3".pmRA,  "I/350/gaiaedr3".e_pmRA,  "I/350/gaiaedr3".pmDE,  "I/350/gaiaedr3".e_pmDE,  "I/350/gaiaedr3".RUWE,  "I/350/gaiaedr3".FG,  "I/350/gaiaedr3".e_FG, 
 "I/350/gaiaedr3".Gmag,  "I/350/gaiaedr3".e_Gmag,  "I/350/gaiaedr3".FBP,  "I/350/gaiaedr3".e_FBP,  "I/350/gaiaedr3".BPmag,  "I/350/gaiaedr3".e_BPmag,  "I/350/gaiaedr3".FRP,  "I/350/gaiaedr3".e_FRP, 
 "I/350/gaiaedr3".RPmag,  "I/350/gaiaedr3".e_RPmag,  "I/350/gaiaedr3"."BP-RP",  "I/350/gaiaedr3".RVDR2,  "I/350/gaiaedr3".e_RVDR2,  "I/350/gaiaedr3".Tefftemp,  "I/350/gaiaedr3".loggtemp,  "I/350/gaiaedr3".PS1, 
 "I/350/gaiaedr3".SDSSDR13,  "I/350/gaiaedr3".SkyMapper2,  "I/350/gaiaedr3".URAT1,  "I/350/gaiaedr3".GmagCorr,  "I/350/gaiaedr3".e_GmagCorr,  "I/350/gaiaedr3".FGCorr,  "I/350/gaiaedr3".RAJ2000,  "I/350/gaiaedr3".DEJ2000
 FROM "I/350/gaiaedr3"





https://gaia.ari.uni-heidelberg.de/tap.html
SELECT 
TOP 1811709771 
    ra,dec, pmra,pmdec, phot_g_mean_mag,phot_bp_mean_mag,phot_rp_mean_mag
FROM 
gaiaedr3.gaia_source
WHERE phot_bp_mean_mag>=17.95 and phot_bp_mean_mag<18.05




