3
голосов
2ответов
7530 просмотров

how to do a select on like values from multiple columns in sql

I have two tables with columns: Genres ID genre and Adjectives ID adjective_title I need to do a select that returns the matching values from both tables columns with the like syntax. For example if ep was the value entered using like the results would look like: result_column...

0
голосов
7ответов
201 просмотров

Getting unique rows/values in SQL

Getting unique rows/values in SQL. I have same some data like this valueA ValueB ValueC test "Value1" "Something" test "Value1" "Something else" test2 "Value1" "Something else" So then I want to get the first two rows since valueC is different and then I also want row 3. but...

0
голосов
1ответов
685 просмотров

Is possible to use nanosleep in a infinite loop with select()?

I have a C program that do recv/send operations from/to socket using a for(;;) loop and a select() to monitor the file descriptor. I need also this program to send a packet every 80msec to a packet, how can I implement this? Maybe I can use a fork() and the child process simply write an ack in o...

0
голосов
1ответов
4027 просмотров

how to disable a jqgrid select list (dropdown) on the edit form

This is strange and any alternative method to what I want to accomplish is welcome. My app uses the jqgrid 3.5.3 and I need to disable a select list on my edit form. When I do so using the code displayed below it breaks the edit form - meaning I can not cancel or submit it. Thanks. This code is i...

1
голосов
3ответов
2250 просмотров

SQL Server: Concatenating WHERE Clauses. Seeking Appropriate Pattern

I want to take a poorly designed SQL statement that's embedded in C# code and rewrite it as a stored procedure (presumably), and am looking for an appropriate means to address the following pattern: sql = "SELECT <whatever> FROM <table> WHERE 1=1"; if ( someCodition.HasValue ) { ...

5
голосов
4ответов
11354 просмотров

Getting no. of rows affected after running select query in SQL Server 2005

Below is my query select @monNameStr as [MName], IsNull(count(c.AssignmentID),0), IsNull(sum(s.ACV),0), IsNull(sum(s.GrossReturn),0), IsNull(sum(s.NetReturn),0), IsNull(avg(a.Total),0) FROM dbo.Assignment_Cla...

10
голосов
3ответов
17293 просмотров

Simple Linq question: How to select more than one column?

my code is: List<Benutzer> users = (from a in dc.Benutzer select a).ToList(); I need this code but I only want to select 3 of the 20 Columns in the "Benutzer"-Table. What is the syntax for that?

0
голосов
4ответов
781 просмотров

Paging and selecting rows starting with a letter from a DB

I have a table where each row is a username with associated vote count The goal is to do paging by username so you can click on the letter C and get to the C's But if there are only like 2 C's, then you wanna show 18 D's as well or 12 D's and 6 E's So how do i find where to start the query li...

0
голосов
1ответов
44 просмотров

best way to automate updates installs

I wanted to know if there was a way to have an app automate to answer the questions.. I have created a batch file that starts the app in the start up folder. so I have 2 problems, one was deleting the batch file once it ran from that folder 2. answering the questions for the app? Is that even ...

1
голосов
1ответов
2353 просмотров

Need a workaround: Python's select.select() doesn't work with subprocess' stdout?

From within my master python program, I am spawning a child program with this code: child = subprocess.Popen(..., stdout=subprocess.PIPE, stdin=subprocess.PIPE) FWIW, the child is a PHP script which needs to communicate back and forth with the python program. The master python program actuall...

0
голосов
1ответов
2760 просмотров

RIA Services - IQueryable Function With Multiple Parameters as Conditions

I am developing an application with RIA Services, and in my DomainService class, I have all that standard functions generated by the RIA for general CRUD operations. The problem is that I tryed to create my own function that insted of listing all the the 45 columns in the Select statment, would l...

0
голосов
2ответов
146 просмотров

jQuery - get select with exactly 2 options

I need to find all select's with exactly 2 options. The code I'm using is: $('select.ct option:nth-child(2)') but it seems to get everything with more than 2 options.

1
голосов
3ответов
301 просмотров

What do you put in a subquery's Select part when it's preceded by Exists?

What do you put in a subquery's Select part when it's preceded by Exists? Select * From some_table Where Exists (Select 1 From some_other_table Where some_condition ) I usually use 1, I used to put * but realized it could add some useless overhead. Wha...

0
голосов
1ответов
3307 просмотров

JQuery enable button based on select

I have a page that contains a collection of select's that are used to identify the columns in a text file. Each time a user identifies a column the selected option is removed from the other selects on the page. When the user has identified all columns the "submit" input needs to be activated so t...

0
голосов
2ответов
968 просмотров

JQuery determine if one or more select has 3 options

I have a page that contains 20 select's with a class name of '.ct'. I need a selector that determines if a select exists that contains 3 or more options. Thanks, Chris

3
голосов
3ответов
787 просмотров

Dropdown not getting populated in IE?

I am trying to get the values to a select list for subcategories on the basis on what is chosen in categories select list. It doesn't seem to work on IE. Can anyone suggest the problem? In the php file I have <body onload="setSubcategories(default_value);"> In the js file I have somethi...

0
голосов
2ответов
129 просмотров

MySql select just one and order by date and blog?

I want to sort data from mysql. The shema looks like this: id int(11) objectId int(11) type tinyint(4) field tinyint(4) value int(11) date int(10) id objectId type field value date 1...

0
голосов
2ответов
3252 просмотров

Is it possible in DB2 or in any Database to detect if the table is locked or not?

Is it possible in DB2 to detect if the table is locked or not. Actually whenever we use Select statement and if that table is locked [ may be because of on going execution of insertion or deletion ] , then we have to wait till the table is unlocked. In our application sometimes it goes to even ...

1
голосов
2ответов
978 просмотров

PHP - Too many mysql_query("SELECT .. ") ..?

Hey, I'm making an e-shop and to display the tree of categories and all the products with their multiple variations of prices I made like more than 150 mysql_query("SELECT ..."); queries on one page. (If I count the "while" loops). Is it too many, and if yes, can it have any negative effect? (of...

17
голосов
4ответов
61497 просмотров

LINQ SELECT FIRST ROW

How can I select first row in a linq select statement without using foreach? I use foreach and then break; but it has to be a better way? I like to get the value in first row; plus check if no row is found. My problem is to get the value without foreach statement. What I do is to find a value ...

2
голосов
6ответов
2848 просмотров

Excluding some columns in a SELECT statement

In the result for SELECT * from myTable WHERE some-condition; I'm interested in 9 of all the 10 columns that exist. The only way out is to specify the 9 columns explicitly ? I cannot somehow specify just the column I don't want to see?

1
голосов
1ответов
190 просмотров

Crystal Reports compare does not work without trim

{AR_Customer.CustomerType} is a 4 character field {AR_Customer.CustomerType}<>"S" does not return all records where this is true unless I do it this way: trim({AR_Customer.CustomerType})<>"S" in the actual database the NULL fields are the ones I'm missing. So this tells me than NUL...

0
голосов
2ответов
171 просмотров

MySQL - Selecting records based on maximum secondary ID

Here's part of my table: id team_id log_id 1 12 1 2 12 1 3 12 1 4 12 1 5 1 2 6 1 2 7 1 3 8 1 3 What query would produce this output (so only the records with the highest log_...

0
голосов
2ответов
1007 просмотров

Dragging a copy of all selected elements from a select box--possible?

I have a picklist web interface: a pair of select elements with a pair of buttons (a left-pointing arrow and a right-pointing arrow) between them. Users can move items between the two columns by, eg, selecting one of options in the left column and clicking on the right-pointing arrow. Now I hav...

13
голосов
5ответов
89933 просмотров

Simple SQL select in C#?

On my current project, to get a single value (select column from table where id=val), the previous programmer goes through using a datarow, datatable and an sqldatadapter (and of course sqlconnection) just to get that one value. Is there an easier way to make a simple select query? In php, I can...

0
голосов
3ответов
3905 просмотров

Jquery Add Values to Select Options

I have googled this option for many days but I couldn't find a solution. What I want is: I have two Select Box First Select Box have Country Names Second Select Box is Empty What I want is when I select any country (i.e United Kingdom) from first select box, a php query should run to get al...

1
голосов
3ответов
624 просмотров

How to SELECT items from from an array (IN clause details)?

I would like to do something in Java (using iBatis, JDBC, etc., really in SQL) like: SELECT SUM(rowName) FROM myTable WHERE id = [myArrayOfIds] Where myArrayOfIds can be almost any length. Now I know you can do: SELECT SUM(rowName) FROM myTable WHERE id IN (x, y, z) but what happens for lon...

2
голосов
2ответов
1759 просмотров

Jquery Add Values to Select

I want to add Options to Select Box using jquery, but my options comes from a MYSQL database table. Here is method what I want: function add_inst(va) { alert(va); } <select id="test"> </select> I want to select values from MySQL table with match value of va, then add these re...

0
голосов
2ответов
3378 просмотров

MySQL: Update all Columns With Values From A Separate Table

Sometimes if I want to quickly copy records from one table to another (that has the same structure) I use a query like this: INSERT INTO table2 SELECT * FROM table1 WHERE id = SOME_VALUE How can I add a ON DUPLICATE KEY UPDATE to this statement? I tried this: INSERT INTO SELECT * FROM...

1
голосов
3ответов
7392 просмотров

Selecting table columns (jQuery)

I want to give ALL (including <th>) cells of FIRST and LAST columns some specific classes, I tried this: $("table tr:first-child td:first-child").addClass("first-col-cell"); $("table tr:last-child td:last-child").addClass("last-col-cell"); ..but it doesn't seem to work. Would appreciate...