select

Mysql count columns of users, and group by modified date

There are 2 columns that I want data from. Basically I want to see new signups per day. Go easy on me, my first day with mysql (or any DB for that matter) So far I have this mysql> select created, count(id) from user group by created; +---------------------+-----------+ | created | count(id) | +---------------------+-------...

Complicated Access SQL Query exclusion

For an access database that looks like this: (All text fields) Co1 Co2 Co3 Co4 A k t N1 B k t N2 A m t N3 B k z N4 A k z N5 C m t N6 C k z N7 C k t N8 A k t N9 C m t N10 I need to create some kind of reports that would do the following: The results needs to select rows: Ordered by Co1 first then ordered by Co2 ...

Show TableViewer not in line, but in matrix order

I use the TableViewer to show informations in a table. The user can select one of the shown options by selecting one line of the table. I want to create a table in matrix form, in which the user can not only select the line. It should be possible to select every item of the table, like row 2 column 3. For every item selection an action ...

Performing a query on a result from another query?

I have a the query: SELECT availables.bookdate AS Date, DATEDIFF(now(),availables.updated_at) as Age FROM availables INNER JOIN rooms ON availables.room_id=rooms.id WHERE availables.bookdate BETWEEN '2009-06-25' AND date_add('2009-06-25', INTERVAL 4 DAY) AND rooms.hostel_id = 5094 GROUP BY availables.bookdate Which returns something l...

MySQL - SQL_BIG_SELECTS

Hey, I've been investigating SQL_BIG_SELECTS, but the MySQL documentation so far has been pretty unhelpful. I'm looking for some insight as to preventing errors like the one below from appearing. ERROR 1104: The SELECT would examine too many records and probably take a very long time. Check your WHERE and use SET OPTION SQL_BIG_SEL...

Why does MySQL not use an index when executing this query?

mysql> desc users; +-------------+------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------+------------------+------+-----+---------+----------------+ | id | int(10) unsigned | NO | PRI | NULL | auto_increment | | email | varc...

jquery table read input field value

Hi all! I made a place management system where you can create, delete or edit placenames. I'ts a table where in every row there is a placename an edit button and an delete button. At the end of the table there is a "create new place" button. Now when I click on the "create new place" button then I get a new generated row where I can wr...

Difference Between Select and SelectMany

Hi, I've been searching the difference between those two but I couldn't find actually what I want. I need learn the difference when using LINQ To SQL but they all gave me standard array examples. Can some one give a LINQ TO SQL Example to show the difference between Select and Select Many. Thanks in advance. ...

What are the differences between poll and select?

I am referring to POSIX standard of select and poll system C API calls? ...

how to override [] brackets in ruby ?

I am writing an Ajax request form with Ruby on Rails using a collection_select tag that looks like this: <%= collection_select("Jobs", "clearance", @allClearances, "clearance", "clearance", {:prompt => "Select a Clearance"} )%> Ruby then builds an HTML select tag with id = "Jobs_clearance" and name = "Jobs[clearance]" I want to send t...

How do I check a MySQL column to make sure it contains a value?

I am trying to select all rows from a database where display = 'Y' and announcement != null. How can I check a column to make sure it contains a value? $qry = "select * from school where display='Y' order by name, announcement, last_update"; ...

correct way to get selected option in jquery from an object

hi. I've seen on StackOverflow and googling around that the most used way to get the selected text from a <SELECT> element with jquery is like this $("#cboId :selected").text() what I have is not the id, but an object. I have an object, say var myCombo= $("#cboId"); coming from an earlier piece of code. I've done like this to get ...

MySQL SELECT with a condition help

CREATE TABLE `comments` ( `comment_id` int(11) NOT NULL AUTO_INCREMENT, `comment_parent_id` int(11) NOT NULL DEFAULT '0', `user_id` int(11) NOT NULL DEFAULT '0', `comment_text` varchar(200) NOT NULL DEFAULT '', `comment_created` int(20) NOT NULL DEFAULT '0', `comment_updated` int(20) NOT NULL DEFAULT '0', `comment_replies_c...

Why does DB2 CHAR() function return '24:00:00' for a time field that is 00:00:00?

I'm querying DB2 on i (AS/400). A plain SELECT statement on a column with datatype of TIME returns 00:00:00, but when I use the CHAR() function it returns '24:00:00'. I understand that 24:00:00 is a valid time, but why would CHAR() return 24 when the native TIME returs 00? ...

MYSQL shows incorrect rows when using GROUP BY

I have two tables: article('id', 'ticket_id', 'incoming_time', 'to', 'from', 'message') ticket('id', 'queue_id') where tickets represent a thread of emails between support staff and customers, and articles are the individual messages that compose a thread. I'm looking to find the article with the highest incoming time (expressed as ...

how to add onchange event to select tag in rails

how do i add onchange event here? Framework: rails Database: MySQL am populating the options from the database and tat made me to use options_from_collection_for_select select_tag(:variable,options_from_collection_for_select(:all, :id, :name)) thanks in advance. ...

Correlated subqueries in MySql - how to evaluate outer query first??

Hi all! I am having problems with subqueries in MySql. I have a table containing user groups. The columns are id, name and the properties with a comment describing each row: (Id is INT, Name VARCHAR, all other TINYINT(1) (boolean that is) ID | Name | login | post | manage 1 user 1 0 0 ...

Dependent select forms

Hi everyone, I'm trying to create a dependent select form like this one on AjaxRay. Here's what I've done so far: http://buzzmedia.com.my/honda/form.html Unlike the example from AjaxRay, my form has multiple rows. I need to figure out how to adapt the code from the AjaxRay example for my own form. ...

jQuery onchange/onfocus select box to display an image?

Hi all, I need some help finding a jQuery plugin which will allow me to display an image preview from a select list of images - onfocus/onchange.. Example: <select name="image" id="image" class="inputbox" size="1"> <option value=""> - Select Image - </option> <option value="image1.jpg">image1.jpg</option> <option value="image2...

JQuery: Selecting Text in an Element (akin to highlighting with your mouse)

I would like to have users click a link that then selects the html text in another element (NOT an input). By "select" I mean the same way you would select text by dragging your mouse over it. This has been a bear to research because everyone talks about "select" or "highlight" in other terms. Is this possible? My code so far is thus: ...