I'm trying to connect to a database via tsql.
I use the following command:
TDSVER=8.0 tsql -S <server IP> -p 1433 -U <my username> -P <my password>
Now, I know the server IP is correct because I can ping it. I also know the port is correct from tsql -LH. It tells me the tcp is 1433.
However,...
I want to Write a sql to query group by data within a certain range in continuous date.I'm usig T-SQL.
Table:
Date | MeterNo| Data |
---------|---------|---------|
01-06-15 | 12345 | 10 |
02-06-15 | 12345 | 12 |
03-06-15 | 12345 | 51 |
04-06-15 | 12345 | 56 |...
I want to Write a sql to query group by data within a certain range in continuous date.I'm usig T-SQL.
Table:
Date | MeterNo| Data |
---------|---------|---------|
01-06-15 | 12345 | 10 |
02-06-15 | 12345 | 12 |
03-06-15 | 12345 | 51 |
04-06-15 | 12345 | 56 |...
someone with a better English than mine, which one is correct (or better if both): - I have learned that I can do this and that - I have learned that I could do this and that
"could" implies possibility, "can" is an assertion of possibility. I can do SQL and I could learn to use MongoDB. I don't know MongoDB yet, but it is possible for me to learn.
They are meant to be suggestions. To me the first one is basically a "less confident" version of the second one, as in "We could use SQL here, [but I'm not sure if that is a good idea". The second one I would use if I was sure it was a good idea.
@Gemtastic Right, then I would be using English wrongly :) I've read on "can vs could" in the past but it's clear I haven't grasped all the nuances correctly.
The nuance is harder to explain than to understand to me. Could should be used in contexts like "I could make a query for that data if you want me to." (offering a possibility that has yet to be confirmed possible.) "I can write SQL queries that fix that issue" (I know how to do this hands down no issues)
> You are my best creative partner and we will build many more great projects together. And as far as I’m concerned, your special son PowerShell can live with us for as long as he needs, even indefinitely. Everyone around the shop loves him and knows he gets a lot done, in his own peculiar way; we just ask him to sit on a towel.
If the variable doesn't need to be used as a stored procedure's argument, one workaround could be to use a view returning a constant value (the value you need to use across multiple batches).
The view would show in the plan but it would likely have a tiny impact on the query cost
Ah, sorry, it's a query that is stored in a variable...
I'm voting to close this question as off-topic because it has been cross-posted at DBA.SE: dba.stackexchange.com/questions/105766/… One question, in one site, is enough. Please do not cross-post. @Kulbir, you are a member for almost 2 years, you should know that. — ypercube3 mins ago