Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.

Export unique host names

marta11's profile image marta11 posted 3 years ago in Import/Export Permalink

Hi there,

i have a problem. I got very big database and i want to export only unique host names. For example:

Host

Windows key, Facebook key, Image key, Windows key

And i want to make it look like that:

Windows key, Facebook key, Image key,

With no multiply names. I know that unique command can be written to query section. Maybe someone can help me there?

ansgar's profile image ansgar posted 3 years ago Permalink
SELECT DISTINCT yourkey FROM yourtable
marta11's profile image marta11 posted 3 years ago Permalink

Entered : select distinct "cd-key" from mytable

and it found only one record with "cd-key"

What i need is all "app" which is named "CD-KEY" with no multiple or doubled hosts.

Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.
ansgar's profile image ansgar posted 3 years ago Permalink

You need to select a column name, not a value in that column. So, if your key column is named "k", then do a SELECT DISTINCT k .... Something in double quotes is considered as string literal, not as a column identifier, and so your SELECT "cd-key or something" always works with one result.

marta11's profile image marta11 posted 3 years ago Permalink

Thank you for your patient.

So if i want to find all unique CD-KEY's from "Windows 7 Ultimate" host, what should i put in query tab?

Adding screenshot prnt.sc/fgankg

ansgar's profile image ansgar posted 3 years ago Permalink

Well, your column seems to be named "login", so it's SELECT DISTINCT login FROM...

marta11's profile image marta11 posted 2 years ago Permalink

Thing is that database exports all unique "login"'s. I need only Windows 7 Ultimate.

Please login to leave a reply, or register at first.