• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

[SQL] return two rows from one

I have a slight problem. I am wanting to optimise a set of tables which seem to have been modelled on text based config files (not the wisest idea) for a server application I have to manage.

The table format I want to use is distributed over a couple of different tables which I can link together without much trouble.

The trouble is that the server application wants the data back like this for a specific username:
id, username, attribute, value, op
10, chickens@tempuri.org, Framed-IP-Address,, :=
11, chickens@tempuri.org, cisco-avpair, ip:route=, :=

The lookup is based on the username for the existing database format.

So how can I somehow maybe join up two queries to return two distinct rows of data?

edit: this has to work with MySQL 4.1 btw ;)
Last edited:
you can't return two rows of data with one query unless the data is on two rows in the database as far as I'm aware.
bugger then, this is what I am needing to do. Will have to investigate if I can stick something in between the database and the application to fetch the data and convert it into what it needs.

@Khayman: I think I need an anti-Union, one query split into two result rows

Members online

No members online now.

Latest posts

Latest profile posts

Perris Calderon wrote on Electronic Punk's profile.
Ep, glad to see you come back and tidy up...did want to ask a one day favor, I want to enhance my resume , was hoping you could make me administrator for a day, if so, take me right off since I won't be here to do anything, and don't know the slightest about the board, but it would be nice putting "served administrator osnn", if can do, THANKS

Been running around Quora lately, luv it there https://tinyurl.com/ycpxl
Electronic Punk wrote on Perris Calderon's profile.
All good still mate?
Hello, is there anybody in there? Just nod if you can hear me ...
What a long strange trip it's been. =)

Forum statistics

Latest member