def _make_query_FROM(FROM=None, inmostquery=False, _tab='    '):
    """Make the FROM portion of a gaia query

    INPUTS:
    -------
    FROM: str (or None)
        User input FROM (though should not have FROM in it)
        Default: None
            goes to 'gaiadr2.gaia_source'
        Useful for nesting queries as an inner query can be input here
    query: str (or None)
        The current query. Gets modified by this function

    RETURNS:
    --------
    query: str
        The query, with FROM added
    """
    # FROM
    if FROM is None:
        FROM = 'gaiadr2.gaia_source'
    else:
        # Tab level
        FROM = _tab + FROM
        FROM = FROM.replace('\n', '\n{tab}'.format(tab=_tab))

    if inmostquery is False:
        p1, p2 ='(\n', '\n)'
    else:
        p1, p2 ='', ''

    s = "\n".join((
            "\n",
            "--SOURCE:",
            "FROM {p1}{userfrom}{p2} AS gaia".format(
                userfrom=FROM, p1=p1, p2=p2)))

    return s