Hey, I'm a little confused about a simple jQuery statement...
I want the operation to proceed only if A and B are true. If A isn't true, stop. If A and B are true, then continue.
Thanks!
Hi friends,
I want to insert 3 rows at a time in a table based on select statement..
consider the query
insert into tblTemp
(
a,b
)
select a, b from tblTemp2
This lets me insert one row in tblTemp..
my requirement is to add 3 rows with iterative values a,a+1,a+2 for each b inserted.
I want to execute select statement within CTE based on a codition. something like below
;with CTE_AorB
(
if(condition)
select * from table_A
else
select * from table_B
),
CTE_C as
(
select * from CTE_AorB // processing is removed
)
But i get error on this. Is it possible to have if else within CTEs? If not is there a work around Or a better approach.
Thanks.
I have column with varchar values like "022008" that I need to convert into a datetime like "02/01/2008". This will run on millions of records for a conversion process. What is an efficient select statement for doing this?
I want to have matlab take user input but accept both cases of a letter. For example I have:
function nothing = checkGC(gcfile)
if exist(gcfile)
reply = input('file exists, would you like to overwrite? [Y/N]: ', 's');
if (reply == [Yy])
display('You have chosen to overwrite!')
else
$ Do nothing
end
end
The if statement obviously doesn't work, but basically I want to accept a lowercase or uppcase Y. Whats the best way to do this?
var ret = []
,xresult = document.evaluate(exp, rootEl, null,
XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null)
,result = xresult.iterateNext();
while (result) {
ret[ret.length]= result;
result = xresult.iterateNext();
}
can anyone explain me what is the ret = [],..,... syntax? Initializing array?
I have a non-disposable class with Open/Close syntax that I'd like to be able to use, so I'm trying to inherit from it, and work the Open into the new and the Close into Dispose.
The second part is ok, but I can't work out how to do the Open:
type DisposableOpenCloseClass(openargs) =
inherit OpenCloseClass()
//do this.Open(openargs) <-- compiler no like
interface IDisposable
with member this.Dispose() = this.Close()
(cf. this question which I asked a long time ago, but I can't join the dots to this one)
I want to be able to perform a IF...THEN in an SQL SELECT Statement.
For Example;
SELECT IF(Obsolete = 'N' or InStock = 'Y';1;0) as Salable, * FROM Product
Hi,
I'm having a hard time figuring out how to do this if statement. I want to do this:
IF (the function has only 1 argument
AND $1 is a directory (in the current
folder)) OR IF (the function has 2
arguments AND $1 is NOT a directory ) THEN
....
END
Sorry if it's not very clear,
Thanks in advance
Hello Friends
I have a DSL for which I intend to create a syntax highlighter for editors like vim, gedit and netbeans.
Has anyone tried this before?
Many thanks for any directions.
Ketan
Hi all.
My question concerns the output of this statement:
for x in range(4), y in range(4):
print x
print y
Results in:
[0, 1, 2, 3]
2
True
2
It seems there is a comparison involved, I just can't figure out why the output is structured like this.
I'd like to get the total count of results and top n rows of some query - is it possible
in one statement?
I'd expect the results as:
count(..) column1 column2
125 some_value some_value
125 some_value some_value
Thank you in advance!
i would like to have cases that evaluate the expression in my switch statement. is this not possible?
switch (zSpeed)
{
case (zSpeed > zMax): this.zSpeed = zMax; break;
case (zSpeed < 0): this.zSpeed = 0; break;
default: this.zSpeed = zSpeed;
}
Is it possible to query for the SQL Server 2008 service startup parameter values using T-SQL? I'm specifically looking for the -g parameter that indicates how much memory that SQL Server will leave available for memory allocations within the SQL Server process, but outside the SQL Server memory pool [msdn reference].
In C# I could easily write the following:
string stringValue = string.IsNullOrEmpty( otherString ) ? defaultString : otherString;
Is there a quick way of doing the same thing in Python or am I stuck with an 'if' statement?
I want to use case in sqlstatement where clause but I have a problem as I want to create a where clause condition on the basis of some value and I want to set a not in clause values on the basis of it
here is the query where am facing an issue
WHERE CODE = 'x' and
ID not in (
case
when 'app'='A' then '570','592'
when 'Q' then ID 592,90
else 592,90
END
but its not syntax
Hi. I'm developing a simple database architecture in VisualParadigm and lately ran over next code excerpt.
IF EXISTS (SELECT * FROM sys.objects
WHERE object_id = OBJECT_ID(N'getType') AND type in (N'P', N'PC'))
DROP PROCEDURE getType;
Next goes my stored procedure:
CREATE PROCEDURE getType @typeId int
AS
SELECT * FROM type t WHERE t.type_id = @typeId;
Can anyone explain what does it mean?
P.S.: It would be great, if you may also check for any syntax errors as I'm totally new to MSSQL and stored procedures.
I was reading a blog post and saw a groovy snippet that looked lik
while ( entry = inputStream.nextEntry ) {
// do something
}
In the while loop, is this groovy syntax that will cause the loop to break when entry is null?
I'm using Google prettify for syntax highlighting and I'd like to modify the colors to match my website theme, but I don't understand some of the abbreviations from these:
str = string
atw
kwd = keyword
tag = tag
com = comment
typ = type?
atn
dec = declaration?
lit
pun = punctuation? like colons, braces?
pln
prettyprint
I wonder if syntax as follows would be helpful in your opinion as a code readability improvent and self-commenting of code:
std::map<std::string name, std::vector<int> scores> myMap;
In this example it clearly says and no other comment is needed, what for we are using myMap variable.
Looking forward to your opinions.
I have a select statement, retrieve about 1000 record
I want to modify it to return only some records defined by @startIndex and @count
e.g. : If I said @startIndex=20 and @count=20
the result will be : from the 21th record to 40th
I try to make it, but it take the same time as if I retrieve the 1000 record
what is the best way to do that
All are from this post.
What does these statement mean:
error(nargchk(5, 6, nargin));
plot(p(:,1), p(:,2), '.-'), axis equal
And what's this kinda syntax which I haven't quite often seen:
if nargin<6, steps = 36; end
Hi,
what the syntax is in Action Mailer Basics rails guide ?
class UserMailer < ActionMailer::Base
def welcome_email(user)
recipients user.email
from "My Awesome Site Notifications <[email protected]>"
subject "Welcome to My Awesome Site"
sent_on Time.now
body {:user => user, :url => "http://example.com/login"}
end
end
How should i understand the construction, like
from "Some text for this field"
Is it an assignment the value to a variable, called "from" ?