Questions tagged [select]

Select is a common keyword used to query data. 'select()' is also a programming function for triggering code based on file handle or other system activity. Do not use this tag for questions related to: HTML selected with jQuery

How do I make the first option of selected with jQuery?
omg
  • 123,990
  • 135
  • 275
  • 341
563
votes
11 answers

MySQL - UPDATE query based on SELECT Query

I need to check (from the same table) if there is an association between two events based on date-time. One set of data will contain the ending date-time of certain events and the other set of data will contain the starting date-time for other…
John M
  • 12,652
  • 28
  • 84
  • 132
519
votes
7 answers

Create a temporary table in a SELECT statement without a separate CREATE TABLE

Is it possible to create a temporary (session only) table from a select statement without using a create table statement and specifying each column type? I know derived tables are capable of this, but those are super-temporary (statement-only) and I…
700 Software
  • 77,509
  • 74
  • 213
  • 324
462
votes
18 answers

Select columns from result set of stored procedure

I have a stored procedure that returns 80 columns, and 300 rows. I want to write a select that gets 2 of those columns. Something like SELECT col1, col2 FROM EXEC MyStoredProc 'param1', 'param2' When I used the above syntax I get the error:…
Rossini
  • 5,560
  • 4
  • 26
  • 31
452
votes
6 answers

SQL query return data from multiple tables

I would like to know the following: how to get data from multiple tables in my database? what types of methods are there to do this? what are joins and unions and how are they different from one another? When should I use each one compared to the…
Fluffeh
  • 31,925
  • 16
  • 62
  • 77
412
votes
18 answers

SQL/mysql - Select distinct/UNIQUE but return all columns?

SELECT DISTINCT field1, field2, field3, ...... FROM table I am trying to accomplish the following sql statement but I want it to return all columns is this possible? Something like: SELECT DISTINCT field1, * from table
aryaxt
  • 69,636
  • 87
  • 281
  • 421
402
votes
32 answers

Select all columns except one in MySQL?

I'm trying to use a select statement to get all of the columns from a certain MySQL table except one. Is there a simple way to do this? EDIT: There are 53 columns in this table (NOT MY DESIGN)
Tom Grochowicz
  • 4,797
  • 3
  • 18
  • 18
386
votes
9 answers

Why does the jquery change event not trigger when I set the value of a select using val()?

The logic in the change() event handler is not being run when the value is set by val(), but it does run when user selects a value with their mouse. Why is this?