Hallo,
ich habe folgendes Problem, bzw. ich finde keinen funktionierenden Weg.
Die Datenbank ist folgendermaßen aufgebaut:
--
-- Tabellenstruktur für Tabelle `products`
--
CREATE TABLE IF NOT EXISTS `products` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`service_a` int(1) NOT NULL,
`service_b` int(1) NOT NULL,
`service_c` int(1) NOT NULL,
`service_d` int(1) NOT NULL,
`service_e` int(1) NOT NULL,
`service_f` int(1) NOT NULL,
`service_g` int(1) NOT NULL,
`service_h` int(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
--
-- Tabellenstruktur für Tabelle `usettings`
--
CREATE TABLE IF NOT EXISTS `usettings` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`service_a1` int(1) NOT NULL DEFAULT '1',
`service_a2` int(1) NOT NULL DEFAULT '1',
`service_b1` int(1) NOT NULL DEFAULT '1',
`service_b2` int(1) NOT NULL DEFAULT '1',
`service_c1` int(1) NOT NULL DEFAULT '1',
`service_c2` int(1) NOT NULL DEFAULT '1',
`service_d1` int(1) NOT NULL DEFAULT '1',
`service_d2` int(1) NOT NULL DEFAULT '1',
`service_e1` int(1) NOT NULL DEFAULT '1',
`service_e2` int(1) NOT NULL DEFAULT '1',
`service_f1` int(1) NOT NULL DEFAULT '1',
`service_f2` int(1) NOT NULL DEFAULT '1',
`service_g1` int(1) NOT NULL DEFAULT '1',
`service_g2` int(1) NOT NULL DEFAULT '1',
`service_h1` int(1) NOT NULL DEFAULT '1',
`service_h2` int(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
ich möchte eine SQL-Abfrage machen, welche mir nur die Boolesche Werte (Standard sind die Bits vom usettings true) "zeilenweise" die mySQL Daten in Tabelle products anzeigt.
ich habe folgendes Problem, bzw. ich finde keinen funktionierenden Weg.
Die Datenbank ist folgendermaßen aufgebaut:
--
-- Tabellenstruktur für Tabelle `products`
--
CREATE TABLE IF NOT EXISTS `products` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`service_a` int(1) NOT NULL,
`service_b` int(1) NOT NULL,
`service_c` int(1) NOT NULL,
`service_d` int(1) NOT NULL,
`service_e` int(1) NOT NULL,
`service_f` int(1) NOT NULL,
`service_g` int(1) NOT NULL,
`service_h` int(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
--
-- Tabellenstruktur für Tabelle `usettings`
--
CREATE TABLE IF NOT EXISTS `usettings` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`service_a1` int(1) NOT NULL DEFAULT '1',
`service_a2` int(1) NOT NULL DEFAULT '1',
`service_b1` int(1) NOT NULL DEFAULT '1',
`service_b2` int(1) NOT NULL DEFAULT '1',
`service_c1` int(1) NOT NULL DEFAULT '1',
`service_c2` int(1) NOT NULL DEFAULT '1',
`service_d1` int(1) NOT NULL DEFAULT '1',
`service_d2` int(1) NOT NULL DEFAULT '1',
`service_e1` int(1) NOT NULL DEFAULT '1',
`service_e2` int(1) NOT NULL DEFAULT '1',
`service_f1` int(1) NOT NULL DEFAULT '1',
`service_f2` int(1) NOT NULL DEFAULT '1',
`service_g1` int(1) NOT NULL DEFAULT '1',
`service_g2` int(1) NOT NULL DEFAULT '1',
`service_h1` int(1) NOT NULL DEFAULT '1',
`service_h2` int(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
ich möchte eine SQL-Abfrage machen, welche mir nur die Boolesche Werte (Standard sind die Bits vom usettings true) "zeilenweise" die mySQL Daten in Tabelle products anzeigt.
Zuletzt bearbeitet: