locked
Redundant Data RRS feed

  • Question

  • Dear All,

    I use Primary KEY ID int IDENTITY PRIMARY KEY while creating tables , problems occur when i want to see the values using this command

    com3.CommandText = "SELECT * FROM UserInfo,OS,ProcessorInfo,RAM,Harddisk WHERE(Datee =(SELECT CONVERT(VARCHAR(10), GETDATE(), 101) AS Expr1))";

    it show me lots of redundant data ,with same ID , i want to show the single data of each Unique ID
    Sunday, March 7, 2010 11:42 PM

Answers

  • You have full cross join, which will produce lots of records because you did not specify how you joined tables. You need to use JOIN statement and specify column names which will be involved into join operation. Based on what you posted, it's hard to say how exactly it should be joined.


    Val Mazur (MVP) http://www.xporttools.net
    Wednesday, March 10, 2010 11:38 AM

All replies

  • Please post the complete SQL statement.

    You left out the FROM clause, which is likely where the problem is.
    Monday, March 8, 2010 11:50 PM
  • You have full cross join, which will produce lots of records because you did not specify how you joined tables. You need to use JOIN statement and specify column names which will be involved into join operation. Based on what you posted, it's hard to say how exactly it should be joined.


    Val Mazur (MVP) http://www.xporttools.net
    Wednesday, March 10, 2010 11:38 AM