473,385 Members | 1,409 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,385 software developers and data experts.

MySQL query in products system

Hi there

I have a products site with a mysql backend.
I have two tables:
1 with series,
1 with products belonging to certain series.

Series looks like:
- id
- kind
- active
- name

Products looks like:
- id
- series_id
- name

Since i'm kind of a newbie, i can't figure out the
following:
I need the query to get all product-information on products that are
in a series where 'series.Active = 1' and 'series.kind = 543' (e.g.
543)
Products have to be limited (e.g. 20)
output sort of has to be:

series.name - products.name - products.id

I hope this is enough information.

Thanks!

Frizzle.

Jul 17 '05 #1
2 1458
frizzle (ph********@gmail.com) decided we needed to hear...
Hi there

I have a products site with a mysql backend.
I have two tables:
1 with series,
1 with products belonging to certain series.

Series looks like:
- id
- kind
- active
- name

Products looks like:
- id
- series_id
- name

Since i'm kind of a newbie, i can't figure out the
following:
I need the query to get all product-information on products that are
in a series where 'series.Active = 1' and 'series.kind = 543' (e.g.
543)
Products have to be limited (e.g. 20)
output sort of has to be:

series.name - products.name - products.id

I hope this is enough information.

Thanks!

Frizzle.


You pretty much defined the query yourself already...

select s.name, p.name, p.id
from series s, products p
where s.active = 1 and s.kind = 543 and s.id = p.series_id
order by s.name, p.name
limit 20

Remove/change the order by as required.
--
Dave <da**@REMOVEbundook.com>
(Remove REMOVE for email address)
Jul 17 '05 #2
Great!
Thanks a bunch!!!!

Greetings Frizzle!
(lots to learn :) )

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
0
by: David | last post by:
Hi, I have a MySQL database and in the front-end software I am using to Run MySQL, I have created a query on the tables which runs in the front-end, similar to the MS Access query grid. I now...
3
by: Gregory.Spencer | last post by:
Hello there, I'm looking for a tool that does for MySQL Db's what Access does for Jet DB's. Therefore provides a nice gui to speedup certain tasks and produce entitiy relationship diagrams....
39
by: Mairhtin O'Feannag | last post by:
Hello, I have a client (customer) who asked the question : "Why would I buy and use UDB, when MySql is free?" I had to say I was stunned. I have no experience with MySql, so I was left sort...
14
by: dottty | last post by:
Hi, i have a table that has the following fields: id, name, dept, pay 1, John, Sales, 4000 2, Peter, HR, 5000 etc. How do i count how many people there are in each dept with an sql query? ...
2
by: basestring | last post by:
Hi I am busy now for many hours without luck I have a database and when I use PHP to add date to it, it works only one time when i want to add the next data, It doesn't work. but i don't get any...
4
by: SBmx | last post by:
hello I need help building a SELECT query... well, two queries actually i have three tables: products / fields id, name, type, country producttypes / fields: id, name countries / fields:...
11
by: rich | last post by:
I'm having a tough time figuring out which of these two options are best. This is a matter of processing my data in PHP, vs MySQL. Usually that's a no brainer, but I have a couple gotchyas here...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.