select

How do I do boolean logic on two columns in MySql, one of which is a Varchar?

This is the sequel to this question. I would like to combine three columns into one on a MySql select. The first two columns are boolean and the third is a string, which is sometimes null. This causes strange results: Select *, (payment1_paid && ((payment2_paid || payment2_type ="none"))) as paid_in_full from payments Note: payment1_...

How can I create an editable dropdownlist in HTML ?

I'd like to create a text field with a dropdown list that lets the user to choose some predefined values. The user should be albe to type a new value or to select a predefined one from a dropdown list. I know that I can use two widgets for that but in my app it would be more ergonomnic if it was unified in a one widget. Is there a stand...

Javascript to sort contents of select element

Hi, is there a quick way to sort the items of a select element? Or I have to resort to writing javascript? Please any ideas. <select size="4" name="lstALL" multiple="multiple" id="lstALL" tabindex="12" style="font-size:XX-Small;height:95%;width:100%;"> <option value="0"> XXX</option> <option value="1203">ABC</option> <option value="101...

Best way to select out of millions of rows in an Oracle DB

G'day! I have one million different words which I'd like to query for in a table with 15 million rows. The result of synonyms together with the word is getting processed after each query. table looks like this: synonym word --------------------- ancient old anile old centenarian old darkened ...

irritating select() behaviour in c

while (xxx) { timeout.tv_sec=TIMEOUT; timeout.tv_usec=0; FD_ZERO(&set); FD_SET(sd,&set); switch (select(FD_SETSIZE,&set,NULL,NULL,&timeout)) xxxxx } works fine, however FD_ZERO(&set); FD_SET(sd,&set); while (xxx) { timeout.tv_sec=TIMEOUT; timeout.tv_usec=0; switch (select(FD_SETSIZE,&set,NULL,N...

SQL: What's the difference between HAVING and WHERE?

I must be googling in the wrong way or I'm having a stupid moment in time. What's the difference between HAVING and WHERE in an SQL SELECT statement? EDIT: I've marked Steven's answer as the correct one as it contained the key bit of information on the link: When GROUP BY is not used, HAVING behaves like a WHERE clause The situat...

Dynamically built SelectCommand for GridView SqlDataSource in asp.net

I'm working with a GridView that uses a SqlDataSource element that looks like this: <asp:SqlDataSource ID="InventoryDB" runat="server" ConnectionString="<%$ ConnectionStrings:InventoryConnectionString %>" SelectCommand="SELECT [Server], [Customer] FROM [Website] WHERE [Owner] = 'someOwner'"> </asp:SqlDataSour...

How to expand 'select' option width after the user wants to select an option.

Maybe this is an easy question, maybe not. I have a select box where I hardcode with width. Say 120px. ABC REALLY LONG TEXT, REALLY LONG TEXT, REALLY LONG TEXT I want to be able to show the second option so that the user can see the full length of the text. Like everything else. This works fine in Firefox, but doesn't work wit...

MySQL: How to select all rows from a table EXCEPT the last one

Hey! I have a table with N rows, and I wanna select N-1 rows. Suggestions on how to do this in one query, if it's possible..? ...

Oracle - Select where field has lowercase characters

Hello, I have a table, users, in an Oracle 9.2.0.6 database. Two of the fields are varchar - last_name and first_name. When rows are inserted into this table, the first name and last name fields are supposed to be in all upper case, but somehow some values in these two fields are mixed case. I want to run a query that will show me al...

Multi Select combo box in dojo grid

I've implemeneted customised single select combo box as a cell element in dojo grid. Can someone tell me how to implement multi select conbo box? ...

Oracle DB query formating problem

Hi, I have a problem with formating the data when doing an query to an Oracle database. What I want to do is to export some data into the formatbelow into a textfile; 1IN20071001 40005601054910101200 1 65 First number (1 above) = Company number (position 1-5, blanks infront) IN or UT = IN for clockin and UT f...

php mysql date/time question

I've built a small application which has User Management, a frontend console to enter data and a backend console to control parts of the frontend. The frontend adds rows to a MySQL database which are timestamped. The backend needs to be able to select rows from the database between X and Y dates. Everything works so far, except the date...

Python, Popen and select - waiting for a process to terminate or a timeout

I run a subprocess using: p = subprocess.Popen("subprocess", stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdid=subprocess.PIPE) This subprocess could either exit immediately with an error on stderr, or keep running. I want to detect either of these condition...

Mysql "magic" catch all column for select statement

Is there a way that I can do a select as such select * from attributes where product_id = 500 would return id name description 1 wheel round and black 2 horn makes loud noise 3 window solid object you can see through and the query select * from attributes where product_id = 234 would return the same results ...

SQL "SELECT IN (Value1, Value2...)" with passing variable of values into GridView

Hi there, I have a strange encounter when creating a GridView using "SELECT..WHERE.. IN (value1, val2...)". in the "Configure datasource" tab, if i hard code the values "SELECT ....WHERE field1 in ('AAA', 'BBB', 'CCC'), the system works well. However, if I define a new parameter and pass in a concatenated string of values using a varia...

Selecting rows where first n-chars are equal (MySQL)

I have a table with playerhandles, like this: 1 - [N] Laka 2 - [N] James 3 - nor | Brian 4 - nor | John 5 - Player 2 6 - Spectator 7 - [N] Joe From there I wanna select all players where the first n-chars match, but I don't know the pattern, only that it's the first n-chars. In the above example I wan't it to return rows 1,2,3,4 and 7...

How can I write an Excel macro to select a group of cells?

I'm looking for a macro which can be run to select a consistent range of cells so that I can easily copy them to another spreadsheet. The range would be F3:BJ3. Thanks for your help. nlh ...

Why does the following print 'Resource temporarily unavailable'?

Why does the following code print ‘read(): Resource temporarily unavailable’ 80% of the time? That is the EAGAIN code, which is the same as WOULD BLOCK which means there is no data waiting to be read, but select is returning 1 saying there is data (tested in Linux): #include <time.h> #include <unistd.h> #include <stdio.h> #include <stri...

Universal Dropdown Menu?

I am trying to create a "quick links" dropdown for a site I'm designing and it has to be compatible for all browsers IE6 and up. It needs to remain 120px wide because its position will be static. Using the < select > command and setting a width, this works; however, when the box is opened, IE cuts off the longer texted links where Firefo...