Questions tagged [clause]
252 questions
0
votes
3 answers
How to use alphanumeric fields with BETWEEN clause in Mysql?
I have a table that contain a field names as mgrs, the value that stored in mgrs fields is like '42SWC227821555' may contain more charachters, and may contain lower case letters. So now i want to search records between two mgrs, so how can i do…

jones
- 1,423
- 3
- 35
- 76
0
votes
2 answers
How do I configure a dataset WHERE clause for a bit column in Visual Basic?
I am using VB 2010 and SQL Server 2008 R2
I have a database table with a column type "Bit". The column name is "Inactive". I have the dataset configured to show all of the data using a fill method. What I want to be able to do is use a Fillby…

Mike Newman
- 1
- 2
0
votes
1 answer
pass variable from bash into where clause of sqlite3
I want to pass that $period variable, as a condition in where clause of sqlite:
It will be in a form of:
-2 hours
-1 day
..or alike.
So it has blank space in it, and it gets into script through getopts,
./script.sh -p "-2 hours"
Then it gets…

branquito
- 3,864
- 5
- 35
- 60
0
votes
1 answer
Question mark(?) is not working with Zend's where clause
Previously our zend 1.1 application was working with PHP 5.3 and Apache 2.2 versions and now we have upgraded our PHP to version 5.4 and Apache to 2.4
After this upgrade Zend's WHERE clause is not working with question mark (?) even it is not…

Yashpal Singh
- 1
- 2
0
votes
1 answer
Conditional WHERE clause to combine two queries
I have a large SELECT INTO statement in a T-SQL script and currently I have two separate SELECT INTO's only differing by one OR condition in the WHERE clause. If my variable @cycle_nbr = 1 I have it doing one SELECT INTO, if @cycle_nbr = 0 I have it…

intA
- 2,513
- 12
- 41
- 66
0
votes
3 answers
where in clause in nested query
I am using mysql and php. I am unable to delete any records even if records exist to meet the condition specified in the query , please help to identify the problem,
my query is
Table1 (id, LName)
table2(id,LName)
delete from table1 where Lname in…

Ajeet
- 49
- 1
- 6
0
votes
1 answer
Issues with SQL Query
as may be quiet aparent, i have very little experience with SQL queries.
I'm having problems with the following Query that i'm generating within my Vb.net application
UPDATE Payments SET B1Code = '12345', ARInvoice = '54321', INV2Go = '00000' WHERE…

Element
- 95
- 9
0
votes
1 answer
Need to pull data when an event happened within a period of a date
I need a clause in my query to bring back data when an event happened within 45 days of another event. An example:
WHERE D1.Date Is within 45 days after D2.date
I am currently using this but I don't think it's getting me what I want:
AND ABS…

user3283554
- 13
- 3
0
votes
1 answer
Listing out maximum price by titles with title name?
I have a database for exercises. I would like to list out the maximum price of different types with the corresponding title name, but of course I can't just put the title name attribute into my SELECT clause, because it does not appear in the GROUP…

Grobi
- 149
- 1
- 2
- 10
0
votes
2 answers
jquery - too much recursion - if.clause
before a submit-action is fired i´m doing a little check before:
$(document).ready(function(){
$("#submit").submit(function(e){
e.preventDefault();
var check = $("#check").val();
if(check == 1) {
$("#submit").submit();
…

user3094856
- 3
- 5
0
votes
2 answers
Why variables cannot be used in where clause of mysql
Using Mysql this statement works:
SELECT *, ABS(UNIX_TIMESTAMP(time) -
UNIX_TIMESTAMP('2013-11-14 14:35:21') ) as diff from Alert
order by diff
limit 3
But if I add a where clause as follows, it gives "Unknown column 'diff' in 'where…

user3098791
- 39
- 1
- 2
- 6
0
votes
2 answers
Oracle SQL Distinct Clause not presenting distinct values
I have a script when I'm trying to select locations in an inventory where quantity of said location is <= 5. The query is complete, now I'm trying to do some fine tuning, and what I'm running into now is when I use the distinct clause I am still…

Nomad
- 250
- 3
- 11
- 27
0
votes
0 answers
Does SQL Server return true on FIRST fulfillment of a multiple OR Condition in a WHERE clause?
I have Table1 with 10 VARCHAR(37) columns and an ID. It has 250 lines.
I want to get for a specific set of 4 char string the count of the lines in TABLE1 which have at least one of the 10 columns containing this 4 char string.
The result will look…

darkdante
- 707
- 1
- 17
- 36
0
votes
1 answer
Clause WHERE in PHP mysql
I just want to update my latest data inserted only.. but I'm sure I'm wrong at WHERE (at $query1 and $query2)

DaneSuegi
- 7
- 4
0
votes
1 answer
SQL Combine same bind variable
I have a where clause that says:
select * from tablename
where :x < y or y is null
and :x > z
I tried to rewrite it so that it uses :x once as shown below but I don't understand why I keep getting an error that says 'SQL command not properly…

K_McCormic
- 334
- 2
- 5
- 17