|
Alternatively you could just add WHERE (column IS NULL or column = '') to your query. It's not pretty, but it would work.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Or WHERE IsNull(column, '') = ''
|
|
|
|
|
dboy221 wrote: "OR cd.BCAT IS ''".
Perhaps you mean OR cd.BCAT = '' ?
|
|
|
|
|
my boss sent me this, I dont know how to do any kinda SQL
Hey Danny, can you make a data entry form so Jane can type customers' email addresses into our database? It needs to have two fields: store number and email address, and a submit button that inserts into sutherlands_mailing_list. Can you save it as www.webice.net/addresses.asp
and the second email she sent
Either way - you're connecting to a table on the SQL server, which is called sutherlands_mailing_list, not an access database. Look at the data entry pages on www.sutherlandshomedesigncenter.com/manager to see how to connect. Your connection string is already built if you use the file include 'database_connect' - you basically just have to write a simple SQL INSERT statement.
can anyone help me with this?
|
|
|
|
|
Does your boss know you do not know SQL? If so you should ask for time to study SQL, especially if you will be in charge of the upkeep of this. If you gave your boss the impression you do know SQL and really don't all I can say is you dug your own hole.
Also it looks like you posted about this in another forum (ASP). Please do not crosspost.
______________________
stuff + cats = awesome
|
|
|
|
|
sorry about the cross post, and i did not tell her that i knew it or hinted at it. I will have a talk i guess
|
|
|
|
|
United States law says that (as long as you did not claim at some point you did know) if you do not know how to do something that is part of your job, the company is required to give you the necessary time and resources (book, class, etc) for you to learn the process in a reasonable amount of time on the company dollar.
______________________
stuff + cats = awesome
|
|
|
|
|
hi all
sir i have made a database and a table and add data in tables in mysql
but then i reinstall another version of mysql .
now i cut the data folder from older version and paste it
into newer version
now when i use show databases in newer version of mysql
it will show that database and tables also
but when i try to show values in tables it will give an error that this table
does not exists
please sir
thanks
hi
|
|
|
|
|
You've already posted this question - just below in fact. Please don't repost.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: You've already posted this question - just below in fact. Please don't repost
Actually, the post below was orginally asking if it was okay to post a question on MySQL in this forum. When I replied that it was okay he then changed the content of the post to the question he wanted to ask.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton
My website
|
|
|
|
|
Hmmmm. Oh well - still breaching the "rules" though.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
|
paras_s12 wrote: can i ask a query related to mysql please in this section
Yes
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton
My website
|
|
|
|
|
I should add that unless your question relates to the way MySQL interacts with .NET applications you may find the responses limited. If it is a purely MySQL question then a forum that deals with that would more likely be useful to you. People will still be able to help you, there are just less of them specialised in that technology here.
Welcome anyway.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton
My website
|
|
|
|
|
Assume that I have a table with UserName and Password columns. Both are varchar type. I given primary key for UserName. But we got another requirement that Password also should not repeat. So I tried setting primary key for Password also. But my first attempt resulted in failure. SQL said you can't create multiple primary keys on a table. Is there a concept called composite key ? Is it related to my requirement ? Or is there any other way to make both fields to be acted like primary key (Both fields should not repeat).?
|
|
|
|
|
You can mark a column as UNIQUE which ensures its value doesn't repeat. However, I don't believe that fits your requirements.
What if two independent users happen, by chance, to pick the same password? What if one of them is mallicious? The fact the second user cannot choose their password means they know someone else already has that password. Now their brute force attack on the system is faster because they have a known password and just have to match it to an existing user.
Most systems don't allow a user to duplicate a password they've used in the past. I would guess that it your requirement. In which case you need to store a history of passwords for each user.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton
My website
|
|
|
|
|
Colin Angus Mackay wrote: What if two independent users happen, by chance, to pick the same password?
Thanks, But this is not the real scenario. I just given a simple example about my requirement. I am using this in another table. Not using for users. Any other way to ensure both of the fields won't repeat ?
|
|
|
|
|
What he told you to do, solves the problem. He was just telling you why not to do it with passwords.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Navaneeth. wrote: Thanks, But this is not the real scenario
Why not tell us the real scenario? It would have mean I didn't have to write all those warnings about security which are, only now, obviously not needed.
Sometimes I really wonder whether I'm wasting my time helping here or not.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton
My website
|
|
|
|
|
Real scenario is, I store ItemCode and ItemName in one table. ItemCode is primary key. I don't want to repeat ItemName also. For that I tried this. Actually I just given a example about username and password to understand the problem easily. But I think I am mistaken and my first example made lot of confusion. Sorry.
Colin Angus Mackay wrote: Sometimes I really wonder whether I'm wasting my time helping here or not.
Never. Your postings are excellent. You are doing good job. Thanks
|
|
|
|
|
Colin Angus Mackay wrote: Sometimes I really wonder whether I'm wasting my time helping here or not.
Not only the poster whom you are replying gets benefited.
It helps everyone who sees you reply.
Colin Angus Mackay wrote: I didn't have to write all those warnings about security
These warning may help others.;)
So you are not wasting you time.
Regards,
Arun Kumar.A
|
|
|
|
|
Instead of creating a single primary key per field, you can select all of the fields that you want and create it as a primary key in one go.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks, I tried that SQL Server created all the selected fields as primary. But still it is checking only the last field. Remaining all fields in the primary list are allowing repeats. Any other alternative for this ?
|
|
|
|
|
The primary key as a whole will be unique. Individual elements within the primary key may not be unique.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton
My website
|
|
|
|
|
If the fields must be unique, then you need to implement a unique index on each field that you want to be unique, e.g.
CREATE UNIQUE
INDEX [] ON [dbo].[Workspace] ([Description])
Deja View - the feeling that you've seen this post before.
|
|
|
|