roaddog Posted March 14, 2015 Share Posted March 14, 2015 Hey.. How to avoid having multiple values in a column? When I store the data in SQL, it most likely get me multiple values in the column. Like I store an account, it can allow me to have 2 or more same account. how to avoid this? In short, No same values in table. I hope you get this. Thanks Link to comment
xXMADEXx Posted March 14, 2015 Share Posted March 14, 2015 I'm not too good with SQL, so I'm not sure if you can do it only with SQL. However, within Lua, you can run a SELECT query (SELECT * FROM tableName) and check to see if the value you're about to insert is already in the table. Link to comment
JR10 Posted March 15, 2015 Share Posted March 15, 2015 Use the UNIQUE constraint. It would save you having to check first if it exists. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now