Top "Select" questions

Select is a common keyword used to query data.

SELECT INTO Variable in MySQL DECLARE causes syntax error?

I´d like to SELECT a single value into a variable. I´d tried to following: DECLARE myvar INT(4); -- …

mysql select mysql-workbench declare
MySQL SELECT WHERE datetime matches day (and not necessarily time)

I have a table which contains a datetime column. I wish to return all records of a given day regardless …

mysql date select
Get index of selected option with jQuery

I'm a little bit confused about how to get an index of a selected option from a HTML <select&…

jquery html select indexing
MySQL select statement with CASE or IF ELSEIF? Not sure how to get the result

I have a two tables. One has manufacturer information and includes the regions where they can sell. The other has …

mysql select case
Explicitly select items from a list or tuple

I have the following Python list (can also be a tuple): myList = ['foo', 'bar', 'baz', 'quux'] I can say >&…

python list select indexing tuples
SQL User Defined Function Within Select

I have a user defined function in SQL called getBuisnessDays it takes @startdate and @enddate and returns the number of …

sql sql-server select user-defined-functions
Return Boolean Value on SQL Select Statement

How to return a boolean value on SQL Select Statement? I tried this code: SELECT CAST(1 AS BIT) AS Expr1 …

sql select boolean
How to add an ORDER BY clause using CodeIgniter's Active Record methods?

I have a very small script to get all records from a database table, the code is below. $query = $this-&…

php codeigniter select activerecord sql-order-by
MySQL - How to select data by string length

SELECT * FROM table ORDER BY string_length(column); Is there a MySQL function to do this (of course instead of …

mysql select string-length
SQL WHERE ID IN (id1, id2, ..., idn)

I need to write a query to retrieve a big list of ids. We do support many backends (MySQL, Firebird, …

sql select