khmerneed
Dec 9 2004, 02:31 AM
| | Dear All Friends!
I have create this topic for everyone who have some problem with query analyses. You could post all your problem with database. We all would have and find a solution for you.
Now let me start my small problem. This i have fixed but i just think of the best way.
I got 3 tables: table_users (user_id,user_name,user_pass,user_group) table_group (group_id,group_name) table_usersingroup (ursingro_id,user_id,group_id)
I need output like this:
username | password | group test1 | ***** | (group1,group2,group3) test2 | ****** | (group2,group3) test3 | **** | (group1,group2,group3,group4)
I hope anyone may solve this problem
Thanks & Best Regards, Dorei  |
Reply
sandymc
Dec 9 2004, 02:52 AM
well, khmer, i cant understand ur question, what ur mean the output will be? do you have already all instances and foreign key connected to each database?, i'm currently learning database management sytem in my coputer science course...
Reply
khmerneed
Dec 9 2004, 03:36 AM
Well, I already build up a relationship, as you may have seen, primarykey and foriegnkey. the output is the data which we need back... for input we are exactly know as well when put box: username box: password slect: groups (multiselect) so, it would be TABLE table_user USERID | USERNAME | PASSWORD 1 | test1 | ***** 2 | test2 | ***** 3 | test3 | ***** TABLE table_group GROUPID | GROUPNAME 1 | Group1 2 | Group2 3 | Group3 4 | Group4 TABLE table_ursingro URSINGROID | USERID | GROUPID 1 | 1 | 1 2 | 1 | 2 3 | 1 | 3 4 | 2 | 2 5 | 2 | 3 6 | 3 | 1 7 | 3 | 2 8 | 3 | 3 9 | 3 | 4 I hope you make sence now... So, the out put which we need is: username | password | group test1 | ***** | (group1,group2,group3) test2 | ****** | (group2,group3) test3 | **** | (group1,group2,group3,group4) Thanks & Best Regards, Dorei
Reply
LuciferStar
Dec 10 2004, 11:06 AM
select table_users.username,table_users.user_pass,table_group.group_name where table_useringroup.user_id=table_users.user_id and table_usersingroup.group_id = table_group.group_id this code may help you to find out the right result, but when you output the result,you need to deal with the result,in order to get such result: test1 | ***** | (group1,group2,group3) that is,all the group name in one record.
Reply
khmerneed
Dec 15 2004, 07:14 AM
Yes, that is what i am trying. Anyway i wonder if anyone have other way which is far better than this. O.K Anyway i wish all members which attend or have some problem with SQL, you may post here, so share the problem solving. Thanks & Best Regards, Dorei
Reply
Similar Topics
Keywords : database query mysql sql server database- Learning Mysql
- pls guide (3)
hello out there, i have already looked through on this tutorial forum.. and still can find any
topics which related to MySql basic.. i wanna learn about how to create MySql table and its
concept!! just basic.. i've no knowledge on MySql before nor any other database server
software.. but i do have littol konwledge on programming,scripting,html basic in concept.. pls dun
gave me so many links so as i can be blur for none about how to get start!! /laugh.gif'
border='0' style='vertical-align:middle' alt='laugh.gif' /> i can thou find from Googles sear...
Baby Web Server (asp)
- (3)
Ipb Mysql Probelm
- (1)
hi im having problem with my IPB database when ever somone submits a post i get this error message
IPS Driver Error CODE mySQL query error: UPDATE trap17_ipbmembers SET points=points+ WHERE
id=1 SQL error: You have an error in your SQL syntax; check the manual that corresponds to your
MySQL server version for the right syntax to use near 'WHERE id=1' at line 1 SQL error
code: Date: Saturday 15th of April 2006 09:49:46 AM can somone please explain
to me what is wrong? use code tags where appropriate. fixed. ...
Mysql...
- and its limits? (11)
I haven't been able to try out any mysql databases, but is more than one really required?
I'm looking at most hosts and most offer unlimited mysql databases. Shouldn't one database
be enough? I would guess one can hold several kinds of information in sub-databases, maybe?...
Mysql: What Do I Do First?
- (3)
I know SQL statements and a little PHP. I want to create an online database and a friend gave me
this cd with tutorials on PHP and MySQL development. I'm lost in all these deleting user,
setting privileges part. Can anyone make me understand these things better? /blink.gif'
border='0' style='vertical-align:middle' alt='blink.gif' /> ...
Installing Apache,mysql And Php In Windows
- Good text for beginners (4)
Here it is the text i have found in CODE http://www.jevontech.com/ , and i'm posting
this text because i remember the dificults i had when i wanted to do this right... Installing
Apache , MySQL and PHP under Windows Introduction While many webservers run Linux, Unix or BSD most
personals computers run on Windows. So it would be quite comfortable if web designers and
developers could develop on their home computer.So in this E-book we will focus on configuring your
computer to use Apache, MySQL and PHP, so you can work on your home computer. Step 1: Ins...
Mysql
- Any help?.. (7)
Alright, well. Let's face it, I can understand PHP, but MySQL seems like... Chinese to Japanese.
Korean to Vietnamese. Totally different, but looks the same to some. Anyway, I was wondering.. Are
there any understandable tutorials out there that involve php? WebMonkey confuses me (@_@) I'll
be eternally in your debt. Edit: It seems I can understand MySQL fairly okay, it's phpMyAdmin
that confuses me. /laugh.gif' border='0' style='vertical-align:middle' alt='laugh.gif' /> -
Zenchi Discalimer: I'm a liar....
Installing A Server On Linux?, Doesn't Seem To Wor
- (0)
I've been trying to install a server on my Mankdrake 10 linux distro machine, but it has failed.
I followed a book, I followed several "install mysql" tutorial stuff and it doesn't seem to
work. I am new to linux and I have never had even an RPM work on this computer. Its not a slow
computer, but it runs a 1.7g Intel Celeron, 300+ Ram (256 + 128), built in graphics and sound -
sound doesn't work, and screensavers are slow as hell. I think the os has lots a problems with
the hardware (duh), and I'm not sure where to get drives (not that ill be able to use...
Looking for database, query, mysql, sql, server, database, talk
|
|
Searching Video's for database, query, mysql, sql, server, database, talk
|
advertisement
|
|