Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 05-25-2005, 08:57 PM   #1 (permalink)
TheShadow
Registered User
 
Join Date: May 2005
Posts: 4
TheShadow is on a distinguished road
ASP ADO SQL Query

I'm having trouble thinking how to write a query ... i have two tables customer and contact ...they share a common element of customerID ... their is a login form based on the contactID, contactPassword within the contact table, based on that i want the contactID and customerID of contact, to display the fields of the customer table ...

Anyone keep up with that?
TheShadow is offline   Reply With Quote
Old 06-09-2005, 07:44 AM   #2 (permalink)
jeffro
Person of interest
 
jeffro's Avatar
 
Join Date: Mar 2003
Location: New Jersey
Posts: 102
jeffro is on a distinguished road
This should get you what you need:
Code:
select t1.*
from customer t1, contact t2
where t1.customerID = t2.customerID
and userInput_ID = t2.contactID
and userInput_Password = t2.contactPassword
Please (anyone), feel free to comment, as my SQL isn't what it could be. ;-) BTW, t1.* probably won't work, its just pseudo code, for any columns in customer you want.
__________________
Jeffro
Linux counter#:213782
GnuPG ID: 406238E7
jeffro is offline   Reply With Quote
Old 06-09-2005, 09:01 AM   #3 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,726
redhead is on a distinguished road
perhaps something like this:
Code:
SELECT * FROM customer WHERE customerID IN (SELECT customerID FROM contact WHERE userInput_ID = contactID AND userInput_Password = contactPassword)
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
help with SQL and VB.NET doobiwan Everything SQL ( MySQL, MSSQL, DB2, Postgre, Oracle, etc...) 4 06-10-2005 08:09 AM
SQL Query Help Please sde Program Design and Methods 6 03-07-2004 11:48 AM
sql query help please sde PHP 7 05-05-2003 05:53 PM


All times are GMT -8. The time now is 06:52 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting