|
thanks
You get the best out of others when you give the best of yourself.
|
|
|
|
|
This may sound a bit weird...
But I need to find the data that does not match between two tables.
I'm using MySql
Suggestions are welcome
Thanks in advance.
modified on Monday, February 11, 2008 1:41 AM
|
|
|
|
|
If you are using SQL 2005, use the EXCEPT operator to find differences between entities.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Sorry, forgot to mention...
I'm using MySql...
I tried using NOT IN but it returns empty...
|
|
|
|
|
What code have you tried?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Something like this...
Search from tableA where id NOT IN (search id that match between tableB and tableA)
|
|
|
|
|
Assuming that you are working with Sql Server, you may try
Select A.[ColumnName],B.[ColumnName2] from table1 A,table2 B
where A.[PKColumn] <> B.[FKColumn]
Give a man a fish, he'll eat for a day. Teach a man how to fish, he'll eat for lifetime.
Pradeep Joe
|
|
|
|
|
Hi,
Say I have the table below:
Tabl1
PKey ColA ColB ColC
1 a1 b1 c1
2 a1 b2 c2
3 a1 b3 c3
... a2 ...
...
... a3 ...
...
If I group by ColA with the select statement as follows:
SELECT<br />
ColA, MAX(ColB), <br />
FROM<br />
Tabl1<br />
GROUP BY<br />
ColA
If for example for a1 the MAX(ColB) is b2, THEN I would like to include ColC in the select statement such that for a1 the resulting row would be:
ColA ColB ColC
a1 b2 c2
What is the best way to do this?
TIA!
I am a SysAdmin, I battle my own daemons.
|
|
|
|
|
select b.*
from (
select ColA, Max(ColB) as MaxColB
from Tabl1
group by ColA
) as a
Tabl1 as b
on b.ColA = a.ColA
and b.ColB = a.ColB
order by b.ColA
|
|
|
|
|
Hi all
I have two DB tables and i want to transfare data from one to another table by some criteria
the first table originalMsg and the other on named as Accepted_nick_name
iwant to select all nick name msg from the originalMsg and insert them to the Accepted_nick_name table
originalMsg
-----------
hi all
Record :timo
its me
Record:Tiko
hi every body
Accepted_nick_name
------------------
Record:timo
Record:Tiko
i do this by this sql query
INSERT INTO Accepted_nick_name (Nickname)
select original_msg_txt from originalMsg where
origainal_msg.original_msg_txt like '%record%'
Thats great and its working but i want the result as
Accepted_nick_name
------------------
timo
Tiko
without the Record word
so how can i modify this word from the set of date to be as i show
plz help me & Thanks alot
Kisha
modified on Sunday, February 10, 2008 4:38 AM
|
|
|
|
|
Use the T-SQL REPLACE function to remove the literal string 'Record:' from your text.
Is it actually necessary to store the string 'Record:' in each record value? What purpose does it serve? It looks like your database design may be broken and could do with normalization.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
thank's for your attention , my DB is well normalization. but its my work requierment
thank's alot for your time
Kareem Elhosseny
|
|
|
|
|
Thank's my dear Paul it works
thanks alot
Kareem Elhosseny
|
|
|
|
|
Dim Client As New WebClient()
Client.DownloadFile("http://www.yahoo.com", "D:\abc\yahoo.html")
when i run this code i am getting out put yahoo.html page when i run this code local host
if i host in remote server i want to download the same page in D:\ or any other directory what i need to give the path.
i getting exception when i run the same code in server.
i am getting out put successfully , when i run local host , pleasee any one can give me solution for this, i want to download file in my local phisical directoy, when i host my dotnet application in remote system.ing the webclient
This is haneef.............................................................
|
|
|
|
|
Don't double-post. It's rude.
Anyway, why did you think it was a good idea to post your question in the SQL forum. Your question has nothing to do with SQL. Next time, I suggest you engage your brain and think for 5 seconds before you post.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Do NOT post the same question in multiple forums. Doing so is considered very rude around here and on other sites as well. And, as you've found out, it doesn't get your question answered any faster.
BTW, what does this have to do with SQL??
|
|
|
|
|
Hi people.This is Amitav Guha From Bangladesh.
How can i deploy a SQL database after designing it?
Can anyone plse answer me.
|
|
|
|
|
You could backup the database on your development server and restore it to your production server.
Alternatively, generate scripts for your database from Management Studio, copy and run them on your production server.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
I figured this out! I has to do with that the web app is logging in using sql authentication and I wasn't.
I have an issue and I don't really know how to put it in words in order to put it in a search engine and hope to get an answer, so I will tell you my problem and I hope you can help me.
My software accesses a SQl Server database using the connection string
("Data Source=.\SQLEXPRESS;AttachDbFilename=" + txtbxdatabase.Text + ";Integrated Security=True;Connect Timeout=30;User Instance=True") (I go the sintax from the connection string created from wizard)
As you can see it gets the name of the database from a text box. This works perfectly until we try to use our software with a third party vender's software.
Third Party software uses ASP to connect to the Sqlserver on station (PC) and writes transaction data to it. When my program tries to open the same Sqlserver on the station (PC) it gets an error (I did not write it down) that, in so many words, would not let my program access the database because it is already in use. I think my connection string is the problem, but I have not found anything helpful online.
Any ideas?
modified on Tuesday, February 12, 2008 8:53 AM
|
|
|
|
|
n my C# program, I get the following error when trying to write to a
table:
"Dynamic SQL generation for the UpdateCommand is not supported against
a SelectCommand that does not return any key column information."
i use this code :
da = new OracleDataAdapter(command, con);
da.MissingSchemaAction = MissingSchemaAction.AddWithKey;
comB = new OracleCommandBuilder(da);
da.Fill(ds, "product");
ds.Tables["product"].PrimaryKey = new System.Data.DataColumn[] { ds.Tables["product"].Columns["item_code"] };
comB.GetUpdateCommand();
da.Update(ds, "product");
Sujit
|
|
|
|
|
Hi Sujit!
Do you have a primary column defined in the Table? If not then defined it.
You must have a primary key defined in your database tables to avoid this error.
I hope this will help you.
Regards.
|
|
|
|
|
Hi friend
Basically i have have a product table which have one primary key item_id. i use this statement for fetching data in dataset ( select itemcode,.......... from table) then i make a primary key in dataset on itamcode.after updating all data in dataset. i use da.update(ds) then it generate error. Where i am wrong please suggest me thanks
Sujit
|
|
|
|
|
hi all
can u plz help me...
here iam writing the query to get top 10 records from tbl_person table.
i.e select Top 10 * from tbl_person
here it is diplaying top 10 ..that is ok
but i want to display the last 10 records(last entered)...
is there any possibilities....
thankyou.
siri
|
|
|
|
|
Apply a sort so that the last entered records are output first.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
hi,
can u plz help me to that...
i have very poor knowledge in dat.
thank u...
siri
|
|
|
|