|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Joins .Vs Lookup Table
Just out of curiousity, I wanted everyone's opinion on what their preferred method for joining data in queries is?
I've been hearing a lot of hype about JOINs and have also heard other's opinions in that they don't like using them. What is your preferred method, and why? Also, what are the main differences between using a Lookup table rather than using JOINs?
__________________
____________________________________________ Developer Shed Weekly Writer | DevArticles Forum Moderator Build Your Own KlipFolio Klip With PHP FrankManno.com - Under Construction Design Interactive Group - Under Construction |
|
#2
|
|||
|
|||
|
I use INNER JOINS in most of my SQL... I like it because it means I only have to do one SQL statement to get all my results... eg:
I can get all my member information at the same time as I can get the news items that member posted..... I don't really know of any other way of doing it!! apart from opening two seperate data sources....... |
|
#3
|
|||
|
|||
|
Fakker,
Would you mind posting an example of how you go about doing your inner joins? I'm sure it would give everyone a better idea, as I find that many people are confused when it comes to JOINs. |
|
#4
|
|||
|
|||
|
PHP Code:
That's the query I do to get my news from my database. It gets news from the news table and gets the admin's email from the admin table. Hope it helps.
__________________
![]() ![]() "Only Linux users see the end of crashes." - Pl4t0 |
|
#5
|
|||
|
|||
|
inner join
SELECT table1.user, table1.stuff, table2.address from (table1 INNER JOIN table2 on table1.user_id = table2.unique_id) order by table.user
|
|
#6
|
|||
|
|||
|
looks like everyone beat me to my answer..!
Yeah, that is how I do my inner join.... but I also kinda cheat.... (sometimes ) ...I first learned how to do the inner joins from Access 2000. When I was creating an ASP site, I did the query in access which wrote the SQL code for me.. then I cut and paste'd it in to my ASP code!! Sometimes the best things in life are.....microsoft? ![]() |
|
#7
|
|||
|
|||
|
oh lordy... I'm gonna get shot for that aren't I?!!!
![]() |
|
#8
|
|||
|
|||
|
you will burn in hell for saying that! and no, im not joking either
|
|
#9
|
|||
|
|||
|
yup....I'm sure gonna pay.... sorry.... but I have never been shown the greener grass on the other side...
I found these on my old back up CD..... you've probably all seen them before..but as they say.. the old ones are the best... enjoy.. http://www.thebluenowhere.co.uk/windoze/windoze.htm ![]() |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Joins .Vs Lookup Table |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|