473,387 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

query problem

19
Can anyone please help with this?
when i run the following query, using SELECT*,

SELECT *
FROM tbl_artwork, tbl_artworkmedium, tbl_medium
WHERE tbl_artwork.artworkID = tbl_artworkmedium.artworkID
AND tbl_artworkmedium.mediumID = tbl_medium.mediumID
AND `dateCreated` =2002

I get more info than i need, (lots of IDs displaying) and type displays oil or watercolour etc. but when i try to get rid of the extra info by running a query which individually specifies the fields, the 'type' shows up as 'type' instead of content of type field. Hope I'm explaining this ok....


SQL-query:
SELECT `title` , `category` , `cost` , `image` , `size` , `paintedOn` , 'type', `dateCreated`
FROM tbl_artwork, tbl_artworkmedium, tbl_medium
WHERE tbl_artwork.artworkID = tbl_artworkmedium.artworkID
AND tbl_artworkmedium.mediumID = tbl_medium.mediumID
AND `forSale` = 'Yes'

this is the result:

title category cost image size paintedOn type dateCreated
Abstract Blue 1 Abstract 250 2000*2500mm canvas type 2001
Abstract Blue 2 Abstract 250 2500*2000mm canvas type 2001
Abstract multi 2 Abstract 290 3000*3000mm canvas type 2002
Abstract Multi 3 Abstract 280 3000*3000mm canvas type 2001
Abstract Multi 6 Abstract 310 3000*2800mm canvas type 2001
Abstract Multi 7 Abstract 290 3000*3000mm canvas type 2002

( i know the above query is to pull through different info than the first, but it's just to illustrate my problem) type is the only field in tblMedium other than the PK.
thanks,
Diz
Mar 26 '06 #1
2 1414
CaptainD
135 100+
Not sure what SQL language you're using, I use T-Sql (Microsoft) Anyway, looking at your SQL statement.
SQL-query:
SELECT `title` , `category` , `cost` , `image` , `size` , `paintedOn` , 'type', `dateCreated`
FROM tbl_artwork, tbl_artworkmedium, tbl_medium
WHERE tbl_artwork.artworkID = tbl_artworkmedium.artworkID
AND tbl_artworkmedium.mediumID = tbl_medium.mediumID
AND `forSale` = 'Yes'
The characters that indicate a field look different then the quotes around 'type',
I'm not sure what character you're using but the others kick back. Could that be your problem?
Mar 26 '06 #2
Diz
19
that could be it, i'm using mysql in phpmyadmin, and i've added all of the other fields automatically, but had to type in 'type' myself. I'll have a good look at the keyboard and see if i can find a match for the other character. Thanks.
Mar 27 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Wescotte | last post by:
Here is a small sample program I wrote in PHP (running off Apache 1.3.31 w/ PHP 5.0.1) to help illustrates problem I'm having. The data base is using DB2 V5R3M0. The client is WinXP machine using...
3
by: Brian Oster | last post by:
After applying security patch MS03-031 (Sql server ver 8.00.818) a query that used to execute in under 2 seconds, now takes over 8 Minutes to complete. Any ideas on what the heck might be going...
1
by: Jeff Blee | last post by:
I hope someone can help me get this graph outputing in proper order. After help from Tom, I got a graph to display output from the previous 12 months and include the average of that output all in...
8
by: Adam Louis | last post by:
I would like help resolving this problem. I'm a novice who's been hired to query a hospital database and extract useful information, available to me only in a dynamically generated, downloadable...
6
by: Martin Lacoste | last post by:
Ok, before I headbutt the computer... don't know why when I add criteria in a query, I get an 'invalid procedure call'. I also don't know why after searching the help in access, the various access...
4
by: Apple | last post by:
1. I want to create an autonumber, my requirement is : 2005/0001 (Year/autonumber), which year & autonumber no. both can auto run. 2. I had create a query by making relation to a table & query,...
11
by: Andy_Khosravi | last post by:
My problem: I'm having trouble with a query taking much too long to run; a query without any criteria evaluating only 650 records takes over 300 seconds to run (over the network. On local drive...
4
by: Konrad Hammerer | last post by:
Hi! I have the following problem: I have a query (a) using another query (b) to get the amount of records of this other query (b), means: select count(MNR) as Number from...
4
by: Stan | last post by:
I am using MS Office Access 2003 (11.5614). My basic question is can I run a query of a query datasheet. I want to use more that one criteria and can not get that query to work. I thought I...
2
by: existential.philosophy | last post by:
This is a new problem for me: I have some queries that open very slowly in design view. My benchmark query takes about 20 minutes to open in design view. That same query takes about 20 minutes...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.