neuralib.sqlp.stat.SqlSelectStat
- class neuralib.sqlp.stat.SqlSelectStat[source]
Bases:
SqlStat[T],SqlWhereStat,SqlLimitStat,Generic[T]SELECT statement.
Methods
__init__(table)add(stat)Add SQL token.
build()build a SQL statement.
drop()except_(stat)EXCEPThttps://www.sqlite.org/lang_select.html#compound_select_statementssubmit and fetch all as a polar dataframe.
fetchall()submit and fetch all result.
fetchone()submit and fetch the first result.
group_by(*by)having(*exprs)intersect(stat)INTERSECThttps://www.sqlite.org/lang_select.html#compound_select_statementsjoin()JOINhttps://www.sqlite.org/lang_select.html#strange_join_nameslimit(*args)order_by(*by)submit()build the SQL statement and execute.
union(stat[, all])UNIONhttps://www.sqlite.org/lang_select.html#compound_select_statementswhere(*expr)WHEREclause: https://www.sqlite.org/lang_select.html#whereclausewindows(*windows, **window_ks)define windows.
Attributes
alias of
Literal['left', 'right', 'inner', 'full outer', 'cross']- windows(*windows, **window_ks)[source]
define windows.
- Parameters:
windows (SqlWindowDef | SqlAlias[SqlWindowDef])
window_ks (SqlWindowDef)
- Return type:
Self
- BY
alias of
Literal[‘left’, ‘right’, ‘inner’, ‘full outer’, ‘cross’]
- join(constraint: Callable | ForeignConstraint, *, by: BY = None) SqlSelectStat[tuple][source]
- join(table: type[S] | SqlAlias[S], constraint: Callable | ForeignConstraint, *, by: BY = None) SqlSelectStat[tuple]
- join(table: type[S] | SqlSelectStat[S] | SqlAlias[S] | SqlCteExpr, *field: bool | Any, by: BY = None) SqlSelectStat[tuple]
- join(*field: bool | Any, by: BY = None) SqlSelectStat[tuple]
JOINhttps://www.sqlite.org/lang_select.html#strange_join_names>>> select_from(A.a, B.b).join(A.a == B.a) SELECT A.a, B.b FROM A JOIN B ON A.a = B.a
- group_by(*by)[source]
GROUP BYhttps://www.sqlite.org/lang_select.html#resultset- Return type:
Self
- having(*exprs)[source]
HAVINGhttps://www.sqlite.org/lang_select.html#resultset- Parameters:
exprs (bool | SqlExpr)
- Return type:
Self
- intersect(stat)[source]
INTERSECThttps://www.sqlite.org/lang_select.html#compound_select_statements- Parameters:
stat (SqlStat)
- Return type:
Self
- union(stat, all=False)[source]
UNIONhttps://www.sqlite.org/lang_select.html#compound_select_statements- Parameters:
stat (SqlStat)
- Return type:
Self
- except_(stat)[source]
EXCEPThttps://www.sqlite.org/lang_select.html#compound_select_statements- Parameters:
stat (SqlStat)
- Return type:
Self