Reputation: 21
In a project I made a table, but when I went to do: SELECT * FROM TableName
I have been getting 101, 102, 103, 104, 105, 101, 102, 103, 104, 105. I only want it to do 101 - 105.
Create TABLE Cust (Customer_Number CHAR(3), address VARCHAR(20), balance SMALLMONEY
INSERT INTO Cust (Customer_number, balance, address)
VALUES (101, 200, null), (102, 700, null), (103, 1000, null), (104, 1500, null), (105, 2000, null)
SELECT *
FROM Cust
That is what I have and as I said I keep getting 10 slots instead of 5. Not sure what I'm doing wrong, every time I have done the SELECT * FROM ()
command I have always got it to double or triple up? Any help will help also thanks in advanced.
Upvotes: 0
Views: 71
Reputation: 58
Some times when we are in hurry and end up doing some thing wrong unknowingly. So please use
Truncate Table Table_name
to truncate the table and then re-insert the rows. Also keep in mind that char and varchar data needs to be within single quotes.
Upvotes: 0
Reputation: 28771
You have done insertion on table multiple times . First empty all the data and then do the INSERT
TRUNCATE TABLE Cust
Upvotes: 0