|
|
-
MisterMagoo Commented 7 Months ago through Just Learned | 1 Point
Dear Satyajit,
I just received this comment from you - which does not seem to show up on site...
Quote : "Please check your facts before mentioning any post as incorrect. I have mentioned to avoid using it...it means as a good practice one should ...
|
-
MisterMagoo Commented 7 Months ago through Just Learned | 1 Point
My previous comment was written on a mobile, so it was brief, but here is how your query should be written:
SELECT temp.a
FROM #temp AS temp
WHERE temp.a IN (SELECT temp1.b FROM #temp1 AS temp1) ;
SELECT temp.a
FROM #temp AS temp
...
|
-
MisterMagoo Liked 7 Months ago through Just Learned | 1 Point
Found another good reason to avoid using IN clause in your TSQL Queries. See the example below:
.userprofile
{
color: #36c;
font-size: 12px;
font-weight: bold;
text-decoration: none;
}
.userprofile A:VISITED
{
color: #039;
font-size: 16px;
font-weight: bold;
text-decoration: none;
}
.userprofile A:HOVER
{
font-size: 16px;
font-weight: bold;
text-decoration: underline;
}
|
-
MisterMagoo incorrect 7 Months ago through Just Learned | 1 Point
Found another good reason to avoid using IN clause in your TSQL Queries. See the example below:
.userprofile
{
color: #36c;
font-size: 12px;
font-weight: bold;
text-decoration: none;
}
.userprofile A:VISITED
{
color: #039;
font-size: 16px;
font-weight: bold;
text-decoration: none;
}
.userprofile A:HOVER
{
font-size: 16px;
font-weight: bold;
text-decoration: underline;
}
|
-
MisterMagoo Commented 7 Months ago through Just Learned | 1 Point
That is correct.
You selected "a" in your IN clause so it will return every row.
Another reason to use aliases......
|
-
MisterMagoo Commented 7 Months ago through Just Learned | 1 Point
Dimitri is correct, binary_checksum and checksum are both inaccurate for matching data.
Eriks alternative solution is better....
|
-
MisterMagoo Liked 7 Months ago through Just Learned | 1 Point
Copy And paste Query
Create table #temp1
(
id int ,
Name varchar(50),
City varchar(50)
)
Create table #Staging_temp2
(
id int,
Name varchar(50),
City varchar(50)
)
insert into #temp1
...
|
-
MisterMagoo incorrect 7 Months ago through Just Learned | 1 Point
Copy And paste Query
Create table #temp1
(
id int ,
Name varchar(50),
City varchar(50)
)
Create table #Staging_temp2
(
id int,
Name varchar(50),
City varchar(50)
)
insert into #temp1
...
|
-
MisterMagoo Commented 2 Years ago through Just Learned | 1 Point
Thanks - I haven't worked out how to do this quickly in my head though :(...
|
-
MisterMagoo Commented 2 Years ago through Just Learned | 1 Point
Thanks - I haven't worked out how to do this quickly in my head though :(...
|