Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
error
Could not execute query [Select NO_OF_ADS_AT_A_TIME from ADQUICK_USER_AD_PREFERENCES WHERE WEBSITE_ID = '1002'] - Unknown column 'NO_OF_ADS_AT_A_TIME' in 'field list't'


SQL
I've created a table with the name "ADQUICK_USER_AD_PREFERENCES WHERE WEBSITE_ID" value = 1002
and colom "NO_OF_ADS_AT_A_TIME" same error
whether there is another solution


:confused::confused:

my site

login

http://www.ads.pcboxsearch.com/browse.php[^]

http://pcboxsearch.com/1.JPG[^]
http://pcboxsearch.com/2.JPG[^]
http://pcboxsearch.com/3.JPG[^]
Posted
Updated 4-Feb-10 8:37am
v4

ariodoni wrote:
I've created a table with the name "ADQUICK_USER_AD_PREFERENCES WHERE WEBSITE_ID"


if "ADQUICK_USER_AD_PREFERENCES WHERE WEBSITE_ID" is your tablename, then you need to think of a new and better name.
 
Share this answer
 
Just yesterday as a client handed me stuff with spaces in the names, I was thinking how much I dislike spaces in names. Even when they are legal, they can cause all sorts of interesting occurrences when software tries to parse them.

According to your 1.jpg you really do have both a table called "ADQUICK_USER_AD_PREFERENCES" and another one called "ADQUICK_USER_AD_PREFERENCES WHERE WEBSITE_ID."

This is causing your code fits, and could inspire future maintenance programmers (possibly including yourself) to cuss you out. Some of the words you've chosen are even worse than spaces, as this name looks like an SQL fragment.

Your 3.jpg shows the fields in "ADQUICK_USER_AD_PREFERENCES WHERE WEBSITE_ID", but you don't provide the detail for "ADQUICK_USER_AD_PREFERENCES." Also, we don't know your actual goal.


ariodoni wrote:
[Select NO_OF_ADS_AT_A_TIME from ADQUICK_USER_AD_PREFERENCES WHERE WEBSITE_ID = '1002']


This is looking for all tuples in "ADQUICK_USER_AD_PREFERENCES" with a WEBSITE_ID of '1002' and returning NO_OF_ADS_AT_A_TIME from those tuples. It isn't doing anything with your table "ADQUICK_USER_AD_PREFERENCES WHERE WEBSITE_ID."


ariodoni wrote:
error
Could not execute query [Select NO_OF_ADS_AT_A_TIME from ADQUICK_USER_AD_PREFERENCES WHERE WEBSITE_ID = '1002'] - Unknown column 'NO_OF_ADS_AT_A_TIME' in 'field list't'


This is saying that their is no field called NO_OF_ADS_AT_A_TIME in the table "ADQUICK_USER_AD_PREFERENCES". I presume this is true.

Please change the name of your "ADQUICK_USER_AD_PREFERENCES WHERE WEBSITE_ID" table. Then run your query on it, or run a query on "ADQUICK_USER_AD_PREFERENCES" based on fields actually contained in the table. Which depends on your data and what you need to accomplish.
 
Share this answer
 
You probably typed the name of the column or the table incorrectly.
 
Share this answer
 
Also, if you script out your table and post the script here (by editing your question and adding the script), then we can probably point out your spelling error.
 
Share this answer
 
It seems you are a bit confused. First of all, I thought it was a typo, but it appears you really have a table called [ADQUICK_USER_AD_PREFERENCES WHERE WEBSITE_ID]. Why the heck would you call a table that?

Second of all, you'd want a query something like this:
SQL
SELECT
    NO_OF_ADS_AT_A_TIME
FROM [ADQUICK_USER_AD_PREFERENCES WHERE WEBSITE_ID]
WHERE
    WEBSITE_ID = '1002'


But that's probably wrong, as that table shouldn't even exist. Clean up your database.
 
Share this answer
 
v2
Do not ask new questions once your original question has been answered. And especially don't ask new questions and post them as answers... your question was not an answer at all, so don't post it as one.

Post any new questions you have as entirely new questions. Mark any answers in this questions as "Accepted" if they answered your question. You can also rate questions according to how well they solved your problem (1 means terrible answer, 5 means perfect answer).

The more you give back to the Quick Answers system, the more you will get from it. Remember, we are not a "team" of people hired to help you. We are volunteers who stumbled across this site just like you and just decided to help people. You could even do the same if you like.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900