|
I have the duplicate data in the table how could i retrieve them. ex: the name field is like
1. xyz
2. abc
3. xyz
4. pqr
5. abc
6. ijk
7. mno
here I want only the duplicate records. What is the query?
Thanx in advance.
yamini
|
|
|
|
|
select name FROM tblA GROUP BY name HAVING count(name) > 1
Regards
KP
|
|
|
|
|
|
|
Select name from tblname groupby name having count(name) > 1
Many Thanks,
Adnan Rafiq
muhammadadnanrafiq@gmail.com
|
|
|
|
|
|
Are you doing a job interview where they've given you access to the internet? You seem to be asking interview questions all over the place. If you don't know the answers to the basic questions that you've been asking, then I would suggest that a career in IT is probably not the best option for you.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi all,
i have a darabase in access i wanna edit a column in a table. my coding has no errors. also the dataset gets updated with the change but the real table doesn't get updated .
this is my coding.
OleDbConnection OLEDBcon = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\\WmsFoodCityPerformance.mdb" +
";Jet OLEDB:Database Password=sanuja");
OLEDBcon.Open();
string sel = "SELECT * FROM CON_AKU";
OleDbDataAdapter OLEDBda = new OleDbDataAdapter();
try
{
OleDbCommand OLEDBselcom = new OleDbCommand(sel, OLEDBcon);
OLEDBda.SelectCommand = OLEDBselcom;
}
catch
{
}
finally
{
DataSet ds = new DataSet();
OLEDBda.Fill(ds);
DataTable dt = new DataTable();
dt = ds.Tables[0];
foreach (DataRow dr in dt.Rows)
{
dr.BeginEdit();
dr["BGT_JUN"] = 0;
dr.EndEdit();
dr.AcceptChanges();
dt.AcceptChanges();
}
OLEDBda.Update(ds);
MessageBox.Show("Done");
dataGridView1.DataSource = ds.Tables[0];
}
}
please help
Regards
Ruwandi
rkherath
rkherath
|
|
|
|
|
Hello all:
Using DataGridView connecting to SQL2005 database. I was able to view the dataset on one of the table that I selected.
I would like to use BindingNavigator to save or add a row onto this particular table.
Could someone please give me an example of how i'm going about to do this?
Thanks in advance,
Eyungwah
|
|
|
|
|
in sql programming ,this code can be used
<br />
<br />
using System.Data.SqlClient;<br />
<br />
SqlConnection cn = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=" + Application.StartupPath + "\\MemberShip.mdf;Integrated Security=True;User Instance=True");<br />
SqlCommand cm = new SqlCommand();<br />
cm.Connection = cn;<br />
cm.CommandType = CommandType.Text;<br />
.<br />
.<br />
the insert, select,update and other<br />
.<br />
.<br />
.<br />
but i want to try access database... i mean this:
using System.?????!!!!!
and the connection and commands...?!
|
|
|
|
|
|
thanks allot...
is there any thing in C#
|
|
|
|
|
|
Access uses the standard oledb provider. You still will have through a "Provider=" clause in your connection string.
Hope this gives you a direction to look.
_____________________________________________________________________
Our developers never release
code. Rather, it tends to escape, pillaging the countryside all around.
The Enlightenment Project (paraphrased comment)
Visit Me at GISDevCafe
|
|
|
|
|
using System.Data.OleDb;
string conString =@"Provider=Microsoft.JET.OLEDB.4.0;"
+ @"data source=c:\data\Northwind.mdb";
Learning is not a spectator sport. - D. Blocher
|
|
|
|
|
thanks allot every one... done successfully.
|
|
|
|
|
i have 6000 fields that i have to search, the Fields have different attributes, one of the Column is "Attribute_Code" it consist of 6 pairs of numbers ## ## ## ## ## ##, i dont want to tember with the first 5 pairs, but i want to Edit the last pair to All the 6000 receords.
Please Help
Vuyiswa
|
|
|
|
|
If you know the length, which is seems you do, then use substring
So your code would be something like:
update yourtable set attribute_code = substring(attribute_code,1,10)+'put your new number here'
Make sure you do some good testing before you update the whole table. It might be a good idea to make a copy of the table you are planning on updating.
You can check your update by doing something like:
select substring(attribute_code,1,10)+'put your new number here' from yourtable
Hope that helps.
Ben
|
|
|
|
|
Thank you kubben you are a star, your idea realy worked
Vuyiswa
|
|
|
|
|
How to Resize the Identity column values after delete the Row and Insert the New Row.
Mohan Balal
|
|
|
|
|
what do you mean by Resizing Identity column value?
Mubashir
Software Architect
Storan Technologies Inc, USA
Every job is a self portrait of the person who did it.
|
|
|
|
|
If you are asking about reseting the table identity once you have deleted all the rows, then use DBCC CHECKIDENT to reseed or reset Identity column.
Regards,
Jaiprakash M Bankolli
jaiprakash.bankolli@gmail.com
http://jaiprakash.blog.com/
|
|
|
|
|
|
Can anyone tell me having known the table name, how can I get the column names and their datatype?
I am using the ojdbc14 driver to connect to my Oracle10g database.
My table name is 'orders' and I want to know how many columns it has and of what type.
Is there any query for this?
|
|
|
|
|
to know the column names:
select COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME ='orders'
all the related information would be present when you use
select * from information_schema.columns
try it out!!
Gautham
|
|
|
|